ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


jquery À̹ÌÁö ºä¾î
13³â Àü
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script> <script> /* viewer plugins made by hong */ (function($){ $.fn.hongunViewer = function(maxw,list){ var _image = { start : true, layerh : 0, layert : 0, width : 0, height : 0, leng : 0, list : [], left : 0, top : 0, next : "http://www.soxfactory.com/img/next.gif",//next image prev : "http://www.soxfactory.com/img/prev.gif",// prev image close : "http://www.soxfactory.com/img/close.gif"//close image } var j = this; if(list){ _image.list = list; loading(); } function loading(){// start loading image if(!$(".imgLayer").length) $("body").append(imgLayer()); $(".closeBtn").click(function(){ $("#overPg").remove(); $(".imgLayer").animate({ top : "-3000" },function(){ _image.start = true; $("#overlay").remove(); $(".imgLayer").remove(); }); }); $("#paging").empty(); $("#centerimg").html("<div style='text-align:center;'>loading...</div>"); var img = new Image(); img.onload = function() { if(maxw < img.width){ _image.width = maxw; _image.height = img.height / (img.width / maxw); }else{ _image.width = img.width; _image.height = img.height; } _image.layerw = parseInt(_image.width + 40); _image.layerh = parseInt(_image.height + 60); imgCenter(); show(); img.onload=function(){}; }; img.src = _image.list[_image.leng]; } function show(){ //scrollTo(0,_image.top); $.overlay(); if(_image.start) $(".imgLayer").bodyCenter(); _image.start = false; $(".imgLayer").animate({ top : _image.top, left : _image.left, width : _image.layerw, height : _image.layerh },500,function(){ $.overlay(); $("#centerimg").css("opacity",0); $("#centerimg").html("<div style='text-align:center;'><img name=zb_target_resize style=\ src='"+_image.list[_image.leng]+"'></div>"); $("#centerimg img").css("width",_image.width); $("#centerimg").animate({ opacity : 1 },function(){ if(_image.list.length > 1){ $("#paging").html("Image "+parseInt(_image.leng + 1)+" of "+_image.list.length); var ppv = ""; var ppn = ""; if(_image.leng != 0) ppv = "<img name=zb_target_resize style=\ src='"+_image.prev+"' class='pprev'>"; if(parseInt(_image.leng + 1) < _image.list.length) ppn = "<img name=zb_target_resize style=\ src='"+_image.next+"' class='pnext'>"; if(!$("#overPg").length){ $("body").append("<div id='overPg' style='z-index:100;width:"+_image.width+"';height:400px;'><div style='float:left;'>"+ppv+"</div><div style='float:right;'>"+ppn+"</div></div>"); $("#overPg").css("opacity","0.3"); $("#overPg").bodyCenter("imgLayer"); } $("#overPg").hover(function(){ $("#overPg").css("opacity","0.6"); },function(){ $("#overPg").css("opacity","0"); }); $("#imgLayer").hover(function(){ $("#overPg").css("opacity","0.6"); },function(){ $("#overPg").css("opacity","0"); }); $(".pprev").click(function(){ if(_image.leng > 0){ _image.leng = _image.leng - 1; $("#overPg").remove(); loading(); } }); $(".pnext").click(function(){ if(_image.leng < parseInt(_image.list.length - 1)){ _image.leng = _image.leng + 1; $("#overPg").remove(); loading(); } }); /* $(".imgLayer").animate({ height : parseInt(_image.height + 100) },function(){ $("#paging").append("<span><img name=zb_target_resize style=\ src='"+_image.prev+"' class='pprev'></span>&nbsp;Image "+parseInt(_image.leng + 1)+" of "+_image.list.length+"&nbsp;<span><img src='"+_image.next+"' class='pnext'></span>"); $(".pprev").click(function(){ if(_image.leng > 0){ _image.leng = _image.leng - 1; loading(); } }); $(".pnext").click(function(){ if(_image.leng < parseInt(_image.list.length - 1)){ _image.leng = _image.leng + 1; loading(); } }); }); */ } }) }); } function imgCenter(){ var win = $(window); var x = win.width(); var y = win.height(); _image.left = win.scrollLeft() + x/2 - _image.layerw/2; if(_image.start) _image.top = win.scrollTop() + y/2 - _image.layerh/2; else _image.top = _image.top; if(_image.top < 0){ _image.top = 50; } } function imgLayer(){ // viewerLayer var text = "<div class='imgLayer' id='imgLayer' style='z-index:100;'>"; text += "<div id='layerTop' style='text-align:right;padding:5px 5px 0px 0px'><img name=zb_target_resize style=\ src='"+_image.close+"' class='closeBtn'></div>"; text += "<div id='centerimg'></div>"; text += "<div id='paging' style='text-align:center;padding:5px 0px 0px 0px;'></div>"; text += "</div>"; return text; } if($(this).find('img').length){ $(this).find("img").each(function(index){ _image.list.push($(j).find("img").eq(index).attr("src")); $(this).click(function(){ _image.leng = index; loading(); }); }); } /// image viewer start $.overlay = function(){ if($("#overlay").length) $("#overlay").remove(); var arrayPageSize = $.getPageSize(); $("body").append("<div id='overlay'></div>"); $("#overlay").css("position","absolute"); $("#overlay").css("background","#3A3434"); $("#overlay").css("top","0"); $("#overlay").css("left","0"); $("#overlay").css("zIndex",90); $("#overlay").css("width",arrayPageSize[0]); $("#overlay").css("opacity","0.8"); $("#overlay").css("height",parseInt(arrayPageSize[1] + 100)+'px'); } $.getPageSize = function(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } // image viewer end } $.fn.bodyCenter = function(id){ $(this).css("position","absolute"); var win = $(window); var ts = $(this); var x = win.width(); var y = win.height(); if(!id){ var left = win.scrollLeft() + x/2 - ts.width()/2; var top = win.scrollTop() + y/2 - ts.height()/2; }else{ var po = $("#"+id).position(); var top = parseInt((($("#"+id).height() / 2) + po.top) - (ts.height() / 2)); var left = parseInt((($("#"+id).width() / 2) + po.left) - (ts.width() / 2)); } $(this).css("left",left); $(this).css("top",top); } })(jQuery); </script> <script> $(function(){ $("#imgArea").hongunViewer(800); }); </script> <html> <style> .imgLayer{background:black;color:#FFFFFF;font-size:11px;} </style> <body> <div id='imgArea'> <img name=zb_target_resize style=\ src='http://soxfactory.com/photo/file1267752079.jpg' width=100> <img name=zb_target_resize style=\ src='http://soxfactory.com/photo/file11267752079.jpg' width=100> <img name=zb_target_resize style=\ src='http://soxfactory.com/photo/file31267752079.jpg' width=100> <img name=zb_target_resize style=\ src='http://soxfactory.com/photo/file51267752079.jpg' width=100> <img name=zb_target_resize style=\ src='http://soxfactory.com/photo/file21267751884.jpg' width=100> </div> </body> </html>
ÃßõÃßõ : 495 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,885
input ÀÔ·Â ÇÊµå ¾ÕµÚ °ø¹é ½Ç½Ã°£ Á¦°Å
2,884
Placeholder Æ÷Ä¿½º½Ã °¨Ãß±â
2,883
MySQL Áߺ¹µÈ µ¥ÀÌÅ͸¦ »èÁ¦
2,882
MySQL Áߺ¹ µ¥ÀÌÅÍ È®ÀÎ
2,881
sessionStorage.getItem ¿Í sessionStorage.setItem
2,880
Á¦ÀÌÄõ¸® ·£´ýÀ¸·Î ¹è°æ»ö º¯°æ
2,879
preg match¿¡ °üÇÑ Á¤±Ô½Ä
2,878
Stream an audio file with MediaPlayer ¿Àµð¿À ÆÄÀÏ ½ºÆ®¸®¹Ö Çϱâ
2,877
Audio Streaming PHP Code
2,876
PHP $ SERVER ȯ°æ º¯¼ö Á¤¸®
2,875
Vimeo (ºñ¸Þ¿À) API ¸¦ »ç¿ëÇÏ¿© Ç÷¹À̾î ÄÁÆ®·ÑÇϱâ
2,874
iframe »ç¿ë½Ã ÇÏ´Ü¿¡ ¹ß»ýÇÏ´Â °ø¹é Á¦°Å¹æ¹ý
2,873
¾ÆÀÌÇÁ·¹ÀÓ(iframe) Àüüȭ¸é °¡´ÉÇÏ°Ô Çϱâ
2,872
ºÎÆ®½ºÆ®·¦(bootstrapk)¿¡¼­ »ç¿ëÇÏ´Â class¸í Á¤¸®
2,871
ºÎÆ®½ºÆ®·¦ CSS
2,870
Å©·Ò¿¡¼­ ¸¶Áø Á¶Àý
2,869
PHP ÇöÀç ÆäÀÌÁöÀÇ µµ¸ÞÀθíÀ̳ª urlµîÀÇ Á¤º¸ ¾Ë¾Æ¿À±â
2,868
PHP preg match all()
2,867
PHP ·Î À¥ÆäÀÌÁö ±Ü¾î¿À±â ¸ðµç ¹æ¹ý ÃÑÁ¤¸®!
2,866
[PHP] ¿ø°ÝÁö ÆÄÀÏ ÁÖ¼Ò ³ëÃâ ¾ÈÇÏ°í curl·Î ´Ù¿î·Îµå ¹Þ±â
2,865
PHP ÇÔ¼ö Á¤¸®
2,864
¾ÆÀÌÇÁ·¹ÀÓ(iframe) ºñÀ² À¯ÁöÇϸ鼭 Å©±â Á¶ÀýÇÏ´Â ¹æ¹ý
2,863
PHP ¹è¿­¿¡¼­ ¹«ÀÛÀ§·Î Çϳª »Ì¾ÆÁÖ´Â array rand() ÇÔ¼ö
2,862
PHP Á¤±Ô½Ä Á¤¸®
2,861
PHP Á¤±Ô½ÄÀ» È°¿ëÇÑ ÅÂ±× ¹× ƯÁ¤ ¹®ÀÚ¿­ Á¦°Å ¹× ÃßÃâ ¹æ¹ý
2,860
php Å©·Ñ¸µ ¶Ç´Â ÆÄ½Ì ÇÔ¼ö, Á¤±Ô½Ä ¸ðÀ½
2,859
Á¦ÀÌÄõ¸® ±âº» ¸í·É¾î
2,858
À¥ÆäÀÌÁö °¡·Î ¸ðµå¼¼·Î ¸ðµå ÀνÄÇϱâ
2,857
¸ð¹ÙÀÏ À¥ È­¸é °­Á¦ ȸÀü(°¡·Î¸ðµå °íÁ¤)
2,856
[HTML5]¿¡¼­ frameset ´ëü ¹æ¹ý°ú iframe ¼Ó¼º
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.