PageSourceSearch

https://elfa.moscow/custom/my/js/jquery.bd.move.slider.js

js elfa.moscow collected 2026-10-04 23:22:58 UTC 4,976 bytes, 13 lines download raw bytes

1/**
2 * @name jQuery move slider 
3 * ©copyright - http://bdeveloper.ru/
4 *
5 * depend on jQuery
6*/
7(function(e){e(document).data("bd_resize_reinit",true);e.fn.bdmoveSlider=function(t){function y(e){if(t.clickBtn)t.clickBtn();var n=parseInt(r.css("left")),u=Math.round(s.width()/o),a=-(o*(i.length-u)),f=0,c=false;if(t.slidenator&&l)var h=s.width()+parseInt(i.css("margin-right"));else h=o*t.step;if(this.className){var p=this.className.split(" ");for(var d=0;d<p.length;d++){if(p[d]==t.prev.slice(1)){c=p[d];break}}}if(c){if(n>=f){b(a)}else{if(n>=-h)b(0);else b("+="+h)}}else{if(n>a){if(n<=a+h)b(a);else b("-="+h)}else{b(0)}}}function b(n){function c(){r.animate({left:n},t.durationMove,t.easingMove,function(){e(this).stop(true);if(t.timer&&v){clearInterval(v);v=setInterval(y,t.interval)}if(t.info||t.slidenator){if(t.slidenator&&l)var n=s.width()+parseInt(i.css("margin-right"));else n=o;a=Math.ceil(-parseInt(r.css("left"))/n)}if(t.slidenator)e(f.find(t.slidenatorItem).get(a)).addClass(t.slidenatorActive.slice(1));if(t.info)e(i.get(a)).find(u).fadeIn(t.infoShowDuration,t.easingInfo,function(){e(this).stop(true)});if(t.endMove)t.endMove()})}if(t.info||t.slidenator)var a=Math.round(-parseInt(r.css("left"))/o);if(t.info){e(i.get(a)).find(u).fadeOut(t.infoHideDuration,t.easingInfo,function(){e(this).stop(true);if(t.slidenator)f.find(t.slidenatorItem).removeClass(t.slidenatorActive.slice(1));c()})}else{if(t.slidenator)f.find(t.slidenatorItem).removeClass(t.slidenatorActive.slice(1));c()}}function w(){var u=e(this).index();if(l){var a=Math.round(s.width()/o),f=-(o*(i.length-a)),c=-(u*(s.width()+(u?parseInt(i.css("margin-right")):0))),h=Math.ceil(-parseInt(r.css("left"))/(s.width()+parseInt(i.css("margin-right"))));if(h!=u){if(u==n.find(t.slidenatorItem).length-1)b(f);else b(c)}}else{c=-(u*o),h=Math.round(-parseInt(r.css("left"))/o);if(h!=u)b(c)}}if(!t)t={};t=e.extend({innerPrefix:false,adaptive:false,start:0,prev:(t.innerPrefix||this.selector)+"__prev",next:(t.innerPrefix||this.selector)+"__next",changeByBtn:true,list:(t.innerPrefix||this.selector)+"__list",listWidth:false,item:(t.innerPrefix||this.selector)+"__item",itemWidth:false,step:1,info:false,infoHideDuration:300,infoShowDuration:300,easingInfo:"swing",durationMove:500,slidenator:false,slidenatorItem:(t.innerPrefix||this.selector)+"__slidenator__item",slidenatorItemIn:"",slidenatorActive:(t.innerPrefix||this.selector)+"__slidenator__item_active",slidenatorAfter:false,insertSlidenatorAfter:false,timer:false,interval:1e4,timerToggle:(t.innerPrefix||this.selector)+"__toggle",toggleHTML:"Старт:Стоп",easingMove:"swing",crop:false,clickBtn:false,endMove:false,slidenatorIndexes:""},t);var n=this,r=n.find(t.list),i=n.find(t.item);if(t.crop&&t.crop===true)var s=n.find((t.innerPrefix||this.selector)+"__crop");else if(t.crop===false)s=n;else s=t.crop;if(i.length==1||i.length<=Math.round(s.width()/i.width()))return false;if(t.adaptive){if(t.crop&&t.crop!==true)var o=n.find(t.crop).width();else o=s.width();i.width(o);t.bd_resize_reinit=true;e(window).on("resize",function(){if(t.bd_resize_reinit){t.bd_resize_reinit=false;if(t.timer&&v){clearInterval(v)}setTimeout(function(){if(t.crop&&t.crop!==true)o=n.find(t.crop).width();else o=s.width();i.width(o);r.width(t.listWidth||o*(i.length+3)).css({left:-(-Math.round(parseInt(r.css("left"))/o)*o)});if(t.timer&&v){v=setInterval(y,t.interval)}t.bd_resize_reinit=true},25)}})}else{o=t.itemWidth||i.eq(1).outerWidth(true)}r.width(t.listWidth||o*(i.length+3)).css({position:"relative",left:-(t.start*o)});if(t.itemWidth){i.width(o)}if(t.info){var u=t.info!==true?n.find(t.info):n.find((t.innerPrefix||this.selector)+"__info");u.hide().eq(t.start).show()}if(t.slidenator){var a=t.slidenator!==true?t.slidenator:(t.innerPrefix||this.selector)+"__slidenator",f=e('<span class="'+a.slice(1)+'"></span>'),l=s.width()>i.outerWidth(true);if(l)var c=i.length/Math.round(s.width()/i.width());else c=i.length;for(var h=0;h<c;h++){f.append('<span class="'+t.slidenatorItem.slice(1)+'">'+t.slidenatorItemIn+(t.slidenatorIndexes&&h+1)+"</span>")}if(t.slidenatorAfter)f.after(t.slidenatorAfter);f.find(t.slidenatorItem).eq(t.start).addClass(t.slidenatorActive.slice(1));f.on("click",t.slidenatorItem,w);if(t.insertSlidenatorAfter)e(t.insertSlidenatorAfter).after(f);else n.append(f)}if(t.changeByBtn){var p=e('<span class="'+t.prev.slice(1)+'"></span>'),d=e('<span class="'+t.next.slice(1)+'"></span>');n.append(p).append(d);p.on("click",y);d.on("click",y)}if(t.timer){var v=setInterval(y,t.interval),m=t.toggleHTML,g=e('<span class="'+t.timerToggle.slice(1)+'">'+m.slice(m.indexOf(":")+1)+"</span>");n.append(g);g.toggle(function(){clearInterval(v);v=false;e(this).html(m.slice(0,m.indexOf(":")))},function(){v=setInterval(y,t.interval);
7e(this).html(m.slice(m.indexOf(":")+1))})}return this}})(jQuery)
8
9/* |===============| Инициализация |===============| */
10$(function() {
11	//$('.multi').bdmoveSlider();
12	$('.comments').bdmoveSlider();
13});

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.