1// JavaScript Document 2 3/* *************************** 4* 5* êëàññ äëÿ íåñêîëüêèõ êàðóñåëåê íà îäíîé ñòðàíèöå 6* html äîëæåí áûòü òàêîé 7* 8* <table cellpadding=0 cellspacing=0 class="gallery" id="%id%"> 9* <tr> 10* <td class="gallery-arr-l" onclick="scroll_to(%id%, 'left')"> 11* <img class="slider_arrow" src="/gif/l.gif"> 12* </td> 13* <td align="center"> 14* <div class="browser"> 15* <div class="slidercontainer" id="slidercontainer_%id%"> 16* <ul class="slider_list" id="slider_list_%id%"> 17* <li><a.....><img...> 18* 19****************************** */ 20var sr_l; 21var sr_r; 22var multiSlider = new Class({ 23 Implements: [Events, Options], 24 initialize: function (id, pre_id){ 25 this.sliderLength = 0; 26 this.step = 133; 27 this.margin = 70;//ìàðãèí ìåæäó ôîòêàìè 28 this.n_pic = 1;//êîëè÷åñòâî êàðòèíîê â îêíå 29 this.s_pic = 1;//êîëè÷åñòâî êàðòèíîê íà øàã 30 sr_l = 'disable'; 31 sr_r = 'disable'; 32 33 this.str = '#' + id + ' .foto_slider';//ôîðìèðóåì ñòðîêó äëÿ ôîòîê ñ êëàñîì foto_slider âíóòðè ýëåìíòà ñ #id 34 35 this.fotos = new Array(); 36 this.fotos = $$(this.str); 37 this.str = this.fotos.length; 38 for(this.i=0; this.i < this.str; this.i++) 39 { 40 // this.sliderLength = this.sliderLength + this.step + this.margin; 41 $(this.fotos[this.i]).setProperty('id', 'foto' + id + (this.i + 1)); 42 } 43 this.sliderLength = this.step*this.str; 44 this.sliderLength = this.sliderLength; 45// $('slider_list_' + id).style.width = this.sliderLength + 'px'; 46 47 this.slidercontainer = 'slidercontainer_' + id; 48 this.slider = new Fx.Scroll(this.slidercontainer, { 49 duration: 2000, 50 transition: Fx.Transitions.Quad.easeInOut 51 }); 52 53 this.scroll = new Hash({ 54 'id': id, 55 'slider': this.slider, 56 'x': 1, 57 'fotos': this.fotos.length 58 }); 59// this.onresize_calc(id, 0); 60 element = 'lf_'+pre_id; 61 this.scroll.slider.toElement(element); 62 sr_l = 'enable'; 63 this.cache(pre_id); 64 $('left_conrol').setStyle('cursor', 'pointer'); 65// this.start_position(id); 66 }, 67 posit: function(id){ 68 this.x = this.cache('null'); 69 this.x = $('slidercontainer_' + id).getScroll().x; 70 right_scroll = $('slider_list_' + id).getWidth() - $('slidercontainer_' + id).getWidth() - this.x;//-48; 71 this.x = Math.round(this.x/83) + 1; 72 this.cache(this.x); 73 if(right_scroll <= 0){ 74 $('scroll_r').src = '/images/arrow_right_in.gif'; 75 sr_r = 'disable'; 76 } 77 else{ 78 $('scroll_r').src = '/images/arrow_right.gif'; 79 sr_r = 'enable'; 80 } 81 if(this.x == 1){ 82 $('scroll_l').src = '/images/arrow_left_in.gif'; 83 sr_l = 'disable'; 84 } 85 else{ 86 $('scroll_l').src = '/images/arrow_left.gif'; 87 sr_l = 'enable'; 88 } 89 }, 90 start_position: function(id){ 91 this.posit.delay(5000, this, id); 92 }, 93 onresize_calc: function (id, pid) 94 { 95 if($('slidercontainer_'+id)) 96 { 97 k = window.getWidth()-$('slider_container_block').getLeft()-$('gall_l').offsetWidth - $('gall_r').offsetWidth; 98 leng_1 = (Math.round(k/83)*(83))-83; 99 leng_2 = $('slider_list_' + id).offsetWidth;//-12; 100 101 if(leng_2 < leng_1) 102 { 103 $('slidercontainer_'+id).style.width = leng_2 + 'px'; 104 } 105 else 106 { 107 $('slidercontainer_'+id).style.width = leng_1 + 'px'; 108 } 109 if(pid != 0){ 110 this.state.delay(4000, this, id); 111 } 112 } 113 }, 114 state: function(id) 115 { 116 x_f = $('slidercontainer_' + id).getScroll().x; 117 r_scroll = $('slider_list_' + id).getWidth() - $('slidercontainer_' + id).getWidth() - x_f; 118 119 if(r_scroll <= 0){ 120 $('scroll_r').src = '/images/arrow_right_in.gif'; 121 sr_r = 'disable'; 122 } 123 else{ 124 $('scroll_r').src = '/images/arrow_right.gif'; 125 sr_r = 'enable'; 126 } 127 }, 128 cache: function(x){ 129 if(x == 'null') x = this.scroll.x; else this.scroll.x = x; 130 return x; 131 }, 132 133 scroll_to: function(direct,id){ 134 this.x = this.cache('null'); 135// dx = Math.round($('slidercontainer_'+id).offsetWidth / 83); 136// h = this.sliderLength/83;//87; 137 if(direct == 'right' && sr_r != 'disable') 138 { 139 this.x = this.x + 1; 140 if(this.x < 4){ 141 if (sr_l == 'disable'){ 142 sr_l = 'enable'; 143 $('left_conrol').setStyle('cursor', 'pointer'); 144 } 145 element = 'lf_'+this.x;
146 this.scroll.slider.toElement(element); 147 if(this.x == 3){ 148 sr_r = 'disable'; 149 $('right_control').setStyle('cursor', 'default'); 150 } 151 this.cache(this.x); 152 } 153/* if (sr_l == 'disable'){ 154 sr_l = 'enable'; 155 $('scroll_l').src = '/images/arrow_left.gif'; 156 }*/ 157// this.x = this.x + dx*2; 158// this.foto = 'foto' + this.scroll.id + this.x; 159/* if(this.x >=h){ 160 $('scroll_r').src = '/images/arrow_right_in.gif'; 161 sr_r = 'disable'; 162 } 163 164 if(!$(this.foto)) 165 { 166 this.x = this.scroll.fotos - dx+1; 167 168 }else this.x = this.x - dx; 169 this.foto = 'foto' + this.scroll.id + this.x; 170 if($(this.foto)) 171 { 172 this.li = $(this.foto).getParent().getParent().getPosition($('slider_list_' + this.scroll.id)); 173 this.scroll.slider.start(this.li.x,0); 174 } 175 this.cache(this.x);*/ 176 } 177 if(direct == 'left' && sr_l != 'disable') 178 { 179 this.x = this.x - 1; 180 if(this.x > 0){ 181 if (sr_r == 'disable'){ 182 sr_r = 'enable'; 183 $('right_control').setStyle('cursor', 'pointer'); 184 } 185 element = 'lf_'+this.x; 186 this.scroll.slider.toElement(element); 187 if(this.x == 1){ 188 sr_l = 'disable'; 189 $('left_conrol').setStyle('cursor', 'default'); 190 } 191 this.cache(this.x); 192 } 193 194/* if (sr_r == 'disable'){ 195 sr_r = 'enable'; 196 $('scroll_r').src = '/images/arrow_right.gif'; 197 } 198 199 this.x = this.x - dx; 200 this.foto = 'foto' + this.scroll.id + this.x; 201 if($(this.foto)) 202 { 203 this.li = $(this.foto).getParent().getParent().getPosition($('slider_list_' + this.scroll.id)); 204 this.scroll.slider.start(this.li.x,0); 205 } 206 else 207 { 208 this.x = 1; 209 this.cache(this.x); 210 this.scroll.slider.toLeft(); 211 } 212 this.cache(this.x); 213 if(this.x == 1){ 214 sr_l = 'disable'; 215 $('scroll_l').src = '/images/arrow_left_in.gif'; 216 }*/ 217 } 218 } 219});
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.