SkidderÊÇÒ»¿îÏìӦʽÎÞÏÞÂÖ²¥µÄ jQueryÐýתľÂí²å¼þ¡£Ëü¿ÉÒÔ×Ô¶¯½«Í¼Æ¬¾ÓÖжÔÆ룬×é³ÉÊ×βÏà½ÓµÄÒ»×éͼƬ£¬Í¨¹ýµ¼º½°´Å¥»òÒƶ¯´¥Ãþ»¬¶¯À´Ç°ºóÇл»Í¼Æ¬¡£ËüµÄÌص㻹ÓУº
- ͼƬ×Ô¶¯¾ÓÖжÔÆë¡£
- ÎÞÏÞÑ»·ÂÖ²¥¡£
- ÏìӦʽÉè¼Æ£¬Í¼Æ¬×Ô¶¯ÊÊÓ¦´°¿Ú´óС¡£
- ¿ÉÒÔÔÚÒƶ¯É豸ÉÏ´¥Ãþ»¬¶¯¡£
- ¼æÈÝIE8+µÄIEä¯ÀÀÆ÷¡£
ʹÓ÷½·¨
ʹÓøÃÐýתľÂí²å¼þÐèÒªÔÚÒ³ÃæÖÐÒýÈëjquery.skidder.cssºÍjquery£¬ÒÔ¼°jquery.skidder.jsÎļþ¡£
- <link rel="stylesheet" href="path/to/jquery.skidder.css">
- <script src="path/to/jquery.skidder.js"></script>
- <script src="path/to/jquery.skidder.js"></script>
HTML½á¹¹
¸ÃÐýתľÂíµÄ»ù±¾HTML½á¹¹ÈçÏ£º
- <div class="slideshow" style="display: none;">
- <div class="slide"><img src="1.jpg"></div>
- <div class="slide"><img src="2.jpg"></div>
- <div class="slide"><img src="3.jpg"></div>
- </div>
³õʼ»¯²å¼þ
ÔÚÒ³ÃæDOMÔªËؼÓÔØÍê±ÏÖ®ºó£¬Í¨¹ýskidder()·½·¨À´³õʼ»¯¸ÃÐýתľÂí²å¼þ¡£
- $('.slideshow').skidder();
Ҫȷ±£Í¼Æ¬ÔÚ²å¼þ³õʼ»¯Ö®Ç°¾Í±»È«²¿¼ÓÔØ£¬·ñÔò²»ÄÜÕýÈ·µÄ¼ÆËãͼƬµÄ¸ß¶È¡£¿ÉÒÔʹÓÃimagesloaded.jsÀ´Íê³ÉÕâÏ×÷¡£
- $('.slideshow').each( function() {
- var $slideshow = $(this);
- $slideshow.imagesLoaded( function() {
- $slideshow.skidder();
- });
- });
Òª¶¯Ì¬¸Ä±äͼƬµÄ³ß´ç´óС£¬²å¼þÖÐʹÓÃÁ˵ÚÈý·½µÄsmartresize£º
- $(window).smartresize(function(){
- $('.slideshow').skidder('resize');
- });
ÅäÖòÎÊý
SkidderÐýתľÂí²å¼þµÄÅäÖòÎÊýÈçÏ£º
²ÎÊý | ÃèÊö |
slideClass | slideÔªËصÄclassÃû³Æ¡£Ä¬ÈÏΪ".slide" |
animationType | ¸Ã²å¼þÖ§³ÖCSS¶¯»ºÍjQuery¶¯»¡£¿ÉѡֵΪ£º 'animate', 'css'¡£Ä¬ÈÏֵΪ 'animate' |
lazyLoad | ÀÁ¼ÓÔØ£¬Ä¬ÈÏֵΪfalse |
lazyLoadAutoInit | ĬÈÏֵΪtrue |
lazyLoadWindow | ĬÈÏֵΪ1 |
scaleSlides | ÊÇ·ñ¸ù¾ÝmaxWidth, maxHeightºÍscaleTo²ÎÊýËõ·ÅslideΪͳһµÄÖµ¡£Ä¬ÈÏΪtrue¡£ |
scaleTo | ¶¨ÒåËõ·Åģʽ¡£ÓÐ2ÖÖģʽ£º×îСģʽºÍÏìӦʽģʽ¡£¿ÉѡֵΪ£º"smallest"ºÍ[x, y]¡£"smallest"±íʾ¸ß¶È×îСµÄͼƬ¾ø¶Ô»ÃµÆƬµÄ¸ß¶È¡£[x, y]±íʾʹÓÃÒ»¸öÊý×éÖеÄÁ½¸öÊýÖµÀ´¶¨Òå»ÃµÆƬµÄ±ÈÀý¡£Ä¬ÈÏΪ"smallest"ģʽ¡£ |
maxWidth | ÏÖÔڻõÆƬµÄ×î´ó¿í¶È£¬0»ò"none"±íʾ²»ÏÞÖÆ¡£Ä¬ÈÏΪ800 |
maxHeight | ÏÖÔڻõÆƬµÄ×î´ó¸ß¶È£¬0»ò"none"±íʾ²»ÏÞÖÆ¡£Ä¬ÈÏΪ500 |
preservePortrait | ÔÚÏìӦʽģʽÖиòÎÊýÓÐЧ¡£¾ö¶¨Ð¡ÓÚ±ÈÀýµÄͼƬµÄÌî³äģʽ¡£true±íʾÊÊÓ¦Êӿڸ߶ȣ¬Ë®Æ½·½ÏòÉÏÁô¿Õ°×¡£Ä¬ÈÏΪfalse¡£ |
paging | ÉèÖÃΪtrueʱ£¬²å¼þ»á²éÕÒpagingElementÔªËصİü¹üÔªËØpagingWrapperÀ´ÉèÖÃpadding¡£Èç¹ûÕâÁ½¸öÔªËز»´æÔÚ£¬²å¼þ»á×Ô¶¯´´½¨ËüÃÇ¡£Ä¬ÈÏΪtrue¡£ |
pagingWrapper | ·ÖÒ³Ô²µãµÄ°ü¹üÔªËØ£¬Ä¬ÈÏΪ'.skidder-pager' |
pagingElement | ·ÖÒ³Ô²µãÔªËØ£¬Ä¬ÈÏΪ'.skidder-pager-dot' |
swiping | ÊÇ·ñÔÚÒƶ¯´¥ÃþÉ豸ÉÏÔÊÐíswiping¡£Ä¬ÈÏΪtrue |
leftaligned | Èç¹û²»Ï£Íû»ÃµÆƬ¾ÓÖУ¬ÉèÖÃΪtrue£¬Ä¬ÈÏΪfalse |
cycle | ÊÇ·ñÑ»·ÏÔʾ£¬Ä¬ÈÏΪtrue¡£ |
jumpback | ÔÚ·ÇÑ»·Ä£Ê½Ê±£¬×îºóÒ»ÕŻõÆƬ»áÏÔʾ'return to first slide'¼ýÍ·¡£Ä¬ÈÏΪfalse |
speed | ¹ý¶É¶¯»µÄËٶȣ¬Ä¬ÈÏΪ400 |
autoplay | ÊÇ·ñ×ܲ¥·Å£¬Ä¬ÈÏΪfalse |
autoplayResume | ÊÇ·ñÔÚ»¥¶¯ºó»Ö¸´×Ô¶¯²¥·Å£¬Ä¬ÈÏΪfalse |
interval | ×Ô¶¯²¥·ÅµÄʱ¼ä¼ä¸ô£¬Ä¬ÈÏΪ4000 |
transition | ¹ý¶É¶¯»Ð§¹û£¬'slide' »ò 'fade' |
directionClasses | ÔÚ¹ý¶É¶¯»½áÊøºóΪslidesÌí¼Ó 'left-from-active' ºÍ 'right-from-active' classÀà¡£ |
afterSliding | ÐýתľÂí¸Ä±äºóµÄ»Øµ÷º¯Êý |
afterInit | ÐýתľÂí³õʼ»¯ºóµÄ»Øµ÷º¯Êý |
afterResize | ÐýתľÂí³ß´ç¸Ä±äʱµÄ»Øµ÷º¯Êý |
±¾Õ¾»¶ÓÈκÎÐÎʽµÄתÔØ£¬µ«ÇëÎñ±Ø×¢Ã÷³ö´¦£¬×ðÖØËûÈËÀͶ¯³É¹û
תÔØÇë×¢Ã÷£º ÎÄÕÂתÔØ×Ô£º°®Ë¼×ÊÔ´Íø http://www.aseoe.com/show-79-817-1.html
תÔØÇë×¢Ã÷£º ÎÄÕÂתÔØ×Ô£º°®Ë¼×ÊÔ´Íø http://www.aseoe.com/show-79-817-1.html