1/* 2### Slide by Alek4u ### 3[email protected] 4*/ 5 6(function( $ ){ 7 $.fn.slider = function( options ) { 8 var settings = { 9 'width' : 100, 10 'height' : 100, 11 'padding' : 0, 12 'visibile': 1, 13 'scroll' : 1, 14 'vertical' : false, 15 'timer' : false, 16 'seconds' : 800, 17 'loop' : true, 18 'fading' : false, 19 'summary' : false, 20 'sumcolor': 'lime', 21 'sumcolor': 'red' 22 }; 23 24/* Per adesso loop e timer devono essere entrambi abilitati */ 25 return this.each(function() { 26 var objTimer = false; // eterno problema del timer 27 if ( options ) { 28 $.extend( settings, options ); 29 } 30 31 var $this = $(this); 32 var wichItem = 0; 33 34 var nItem = $("ul:eq(0) li", $this).length; 35 36 $("ul li, ul li div, ul li a", $this).css({'opacity':'inherit', 'filter':'inherit'}); // PER FADEIN FADEOUT 37 $("ul:eq(0)", $this).wrap("<div class=\"slidecont\"></div>").css({'width':(settings['width']+settings['padding']*2)*($("li", $this).length+1),'position':'absolute', 'height':settings['height'], 'padding':0, 'margin':0}) 38 $(".slidecont", $this).css({'width': (settings['width']+settings['padding']*2)*settings['visibile'], 'height':settings['height'], 'overflow': 'hidden', 'position':'relative'}); 39 $(".slidecont > ul > li", $this).css({'width':settings['width'],'height':settings['height'], 'padding':settings['padding'], 'float' : 'left', 'list-style':'none'}) 40 41 if(settings['vertical']){ 42 $this.width(settings['width']) 43 $(".slidecont", $this).css({'height': (settings['height']+settings['padding']*2)*settings['visibile'], 'width':settings['width'], 'overflow': 'hidden', 'position':'relative'}); 44 $("ul:eq(0)", $this).css({'height':(settings['height']+settings['padding']*2)*($("li", $this).length+1),'position':'absolute', 'width':settings['width'], 'padding':0, 'margin':0}) 45 $(".slidecont > ul > li", $this).css({'width':settings['width'], 'height':settings['height'], 'padding':settings['padding'], 'list-style':'none'}) 46 } 47 48 if($(".slidecont > ul > li", $this).length>0){ 49 $this.append("<a class=\"EveSucc\" style=\"position:absolute; right:0px;\">Successiva</a></span>") 50 $this.append("<a class=\"EvePrec\" style=\"position:absolute; left:0px; \">Precedente</a></span>") 51 showhide() 52 if(settings['summary']){ 53 $(this).append("<div id=\"summary\" style=\"position:absolute; left: "+settings['width']/2+"px; margin-left:-"+ nItem*10+ "px; \"></div>"); 54 for(i=0; i<nItem; i++){ $("#summary", $this).append("<span rel=\""+i+"\" style=\"cursor:pointer; display:block; width:10px; height:10px; float:left; border-radius: 5px; -moz-border-radius: 5px; background:"+settings['sumcolor']+"; text-indent:-9999px; margin-right:2px;\">"+i+"</span>") } 55 $("#summary span:eq(0)").css("background", settings['sumcolorOn']) 56 } 57 if(settings['loop']){ $("li:eq(0)", $this).clone().appendTo($this.find('ul'))} 58 } 59 60 if($this.width()==252 && $this.height()==118){ 61 $("li", $this).mouseenter(function(){ 62 clearTimeout(objTimer); 63 $(this).parent().parent().parent().parent().find(".boxleggi").attr("href", $(this).find("a").attr("href")); 64 $(this).parent().parent().parent().parent().find(".boxhover").mouseleave(function(){ 65 startTimer() 66 }) 67 }) 68 } 69 70 function showhide(){ 71 if(!settings['loop']){if(wichItem==0){$(".EvePrec", $this).attr('rel','spento').fadeOut('100')} else {$(".EvePrec", $this).attr('rel','').fadeIn('100');}} 72 if(Math.abs(wichItem)*settings['scroll']>
72=$(".slidecont > ul > li", $this).length-settings['visibile']){$(".EveSucc", $this).attr('rel','spento'); if(!settings['loop']){$(".EveSucc", $this).fadeOut('fast')}}else {$(".EveSucc", $this).attr('rel','').fadeIn('fast');} 73 } 74 75 $("#summary span", $this).click(function(){ 76 wichItem=0-$(this).attr('rel') 77 animate(); 78 showhide(); 79 stopStart(); 80 }) 81 $(".EveSucc", $this).click(function(){ 82 if($(this).attr("rel")!="spento"){ // movimento normale 83 wichItem=wichItem-1; 84 animate(); 85 showhide(); 86 stopStart(); 87 } 88 else if(settings['timer']){ 89 if(settings['loop']){ // cosa succede ultimo elemento, loop con timer 90 wichItem=0; 91 showhide(); 92 $(".slidecont > ul", $this).animate({ left: 0}, 0,function(){ 93 $('.EveSucc', $this).trigger('click'); 94 colorSummary(); 95 }) 96 }else{ // cosa succede ultimo elemento, Senza loop 97 $(".slidecont > ul", $this).animate({ left: 0}, 800); 98 wichItem=0; 99 colorSummary(); 100 showhide(); 101 stopStart(); 102 } 103 } 104 else if(settings['loop']){ // cosa succede ultimo elemento, loop senza timer 105 wichItem=0; 106 showhide(); 107 $(".slidecont > ul", $this).animate({ left: 0}, 0,function(){ 108 $('.EveSucc', $this).trigger('click'); 109 colorSummary(); 110 }) 111 } 112 }) 113 114 $(".EvePrec", $this).click(function(){ 115 if(wichItem==0){ 116 $(".slidecont > ul", $this).animate({ left: 0-((settings['width']+settings['padding']*2)*nItem) },0); 117 wichItem = 0-nItem 118 $('.EvePrec', $this).trigger('click'); 119 } 120 else{ 121 if($(this).attr("rel")!="spento"){ 122 wichItem=wichItem+1 123 animate(); 124 showhide(); 125 stopStart() 126 } 127 } 128 }) 129 130 function animate(){ 131 colorSummary() 132 if(!settings['fading'] && !settings['vertical']){ 133 // Transizione SLIDING ORIZZONATALE 134 $(".slidecont > ul", $this).animate({ left: sp=(wichItem*(settings['width']+settings['padding']*2)*settings['scroll'])}, 800) 135 } else if(!settings['fading'] && settings['vertical']){ 136 // Transizione SLIDING VERTICALE 137 $(".slidecont > ul", $this).animate({ top: sp=(wichItem*(settings['height']+settings['padding']*2)*settings['scroll'])}, 800) 138 } 139 else{ 140 // FADEIN FADEOUT 141 $(".slidecont > ul", $this).animate({opacity:0 }, 200, function(){$("ul:eq(0)", $this).animate({ left: sp=(wichItem*(settings['width']+settings['padding']*2)*settings['scroll'])}, 100, function(){$("ul", $this).animate({ opacity:1 }, 400)})}) 142 } 143 }; 144 function colorSummary(){ 145 if(settings['summary']){ 146 wichItemSum = wichItem; 147 if(settings['loop']){if (Math.abs(wichItemSum) == nItem){wichItemSum=0;}} 148 $("#summary span", $this).css("background", settings['sumcolor']) 149 $("#summary span", $this).eq(Math.abs(wichItemSum)).css("background", settings['sumcolorOn']) 150 } 151 } 152 153 if(settings['timer'] && $this.length>0){ 154 startTimer() 155 } 156 function startTimer(){ 157 objTimer = setTimeout(function(){ 158 $('.EveSucc', $this).trigger('click') 159 }, settings['seconds']); 160 } 161 function stopStart(){ 162 if(settings['timer'] && $this.length>0){ 163 clearTimeout(objTimer); 164 startTimer() 165 } 166 } 167 });
167 // fine funzione 168 }; 169})( jQuery );
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.