1/* 2 3 Suga Slider 4 5 Usage --------- 6 7 $(window).load(function(){ 8 $('#logos').suga({ 9 'transitionSpeed': 2000, 10 'snap': false 11 }); 12 }); 13 14 The markup should resemble the markup here 15 16 */ 17 18$.fn.suga = function (options) { 19 var settings = $.extend({ 20 'transitionSpeed': 7000, 21 'snap': false 22 }, options); 23 24 var $this = $(this); 25 26 // add plugin specific classes 27 $this.addClass('suga-slider-wrap'); 28 $this.children('ul').addClass('suga-slider-group'); 29 $this.find('li').addClass('suga-slide'); 30 31 // caching $$$ 32 var $slide = $('.suga-slide'), 33 $firstEl = $('.suga-slide:first'), 34 $group = $('.suga-slider-group'), 35 $wrap = $('.suga-slider-wrap'); 36 37 var slideWidth = $slide.outerWidth(), 38 slideHeight = $('.suga-slide').height(), 39 slideCount = $slide.length, 40 totalWidth = slideWidth * slideCount; 41 42 43 // set width on group element 44 //$group.width(totalWidth); 45 $wrap.height(slideHeight); 46 47 48 // add first class at start 49 if (!$group.find($firstEl).hasClass("suga-first")) { 50 $group.find($firstEl).addClass("suga-first"); 51 } 52 53 // lets move baby 54 var transitionSnap = function () { 55 var $firstEl = $group.find('.suga-first').html(); 56 57 $group.find('.suga-first').animate({ 58 'margin-left': '-' + slideWidth + 'px' 59 }, function () { 60 $group.append('<li class="suga-slide">' + $firstEl + '</li>'); 61 $(this).remove(); 62 $group.find('li:first').addClass("suga-first"); 63 64 }); 65 }; 66 67 68 if (settings.snap) { 69 window.setInterval(transitionSnap, settings.transitionSpeed); 70 } else { 71 transitionScroll(); 72 } 73} 74 75$(window).load(function () { 76 $('#logos').suga({ 77 'transitionSpeed': 7000, 78 'snap': true 79 }); 80});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.