📁 File Manager
Editing:
/home/wvl7mof7402e/www/astrosureshtripathi.com/js/jquery.als-1.1.min.js
(function(c){function m(e){if("string"===typeof e){var a=e.indexOf("_");-1!=a&&(e=e.substr(a+1))}return e}function p(e){e.preventDefault();e=m(c(this).attr("data-id"));var a=k[e];c(this).off();a.prev.off();c.fn.als("next",e)}function q(e){e.preventDefault();e=m(c(this).attr("data-id"));var a=k[e];c(this).off();a.next.off();c.fn.als("prev",e)}var k=[],h=0,t={init:function(e){this.each(function(){var a=c(this),b=a.data("als"),d=c(),b=c(),l=c(),f=c(),g=c(),j=c(),u=0,n=0,m=0,w=0,x=0,v=0,y=0,z=0,t=0,d= c.extend({visible_items:3,scrolling_items:1,orientation:"horizontal",circular:"no",autoscroll:"no",interval:4E3,direction:"left",start_from:0},e);"no"==d.circular&&"yes"==d.autoscroll&&(d.circular="yes");(!a.attr("id")||""==a.attr("id"))&&a.attr("id","als-container_"+h);f=a.find(".als-viewport").attr("id","als-viewport_"+h);l=a.find(".als-wrapper").attr("id","als-wrapper_"+h);b=a.find(".als-item");u=b.size();d.visible_items>u&&(d.visible_items=u-1);d.scrolling_items>d.visible_items&&(d.scrolling_items= d.visible_items-1);d.start_from>u-d.visible_items&&(d.start_from=0);g=a.find(".als-prev").attr("data-id","als-prev_"+h);j=a.find(".als-next").attr("data-id","als-next_"+h);switch(d.orientation){default:b.each(function(a){m+=c(this).outerWidth(!0);y<d.visible_items&&(n+=c(this).outerWidth(!0),y++);c(this).attr("id","als-item_"+h+"_"+a);0!=d.start_from&&(z<d.start_from&&(v+=c(this).outerWidth(!0),z++),t=d.start_from)});l.css("width",m);b.css("left",-v);f.css("width",n);l.css("height",b.outerHeight(!0)); f.css("height",b.outerHeight(!0));if("yes"==d.circular&&0!=d.start_from)for(r=0;r<d.start_from;r++){var s=b.last().position(),s=s.left+b.last().outerWidth(!0);b.eq(r).css("left",s)}break;case "vertical":if(b.each(function(a){x+=c(this).outerHeight(!0);y<d.visible_items&&(w+=c(this).outerHeight(!0),y++);c(this).attr("id","als-item_"+h+"_"+a);0!=d.start_from&&(z<d.start_from&&(v+=c(this).outerHeight(!0),z++),t=d.start_from)}),l.css("height",x),b.css("top",-v),f.css("height",w),l.css("width",b.outerWidth(!0)), f.css("width",b.outerWidth(!0)),"yes"==d.circular&&0!=d.start_from)for(r=0;r<d.start_from;r++)s=b.last().position(),s=s.top+b.last().outerHeight(!0),b.eq(r).css("top",s)}"no"==d.circular&&(0==d.start_from&&g.css("display","none"),d.visible_items+d.start_from==u&&j.css("display","none"));a.data("als",{container:a,instance:h,options:d,viewport:f,wrapper:l,prev:g,next:j,item:b,num_items:u,wrapper_width:m,viewport_width:n,wrapper_height:x,viewport_height:w,current:t,timer:0});b=a.data("als");k[h]=b;j.on("click", p);g.on("click",q);"yes"==d.autoscroll?(c.fn.als("start",h),l.hover(function(){c.fn.als("stop",c(this).attr("id"))},function(){c.fn.als("start",c(this).attr("id"))})):"no"==d.autoscroll&&c.fn.als("stop",h);h++;return k})},next:function(e){e=m(e);var a=k[e],b=0,b=0;switch(a.options.orientation){default:var d=0,c=0;switch(a.options.circular){default:for(b=a.current;b<a.current+a.options.scrolling_items;b++)d+=a.item.eq(b).outerWidth(!0);a.current+=a.options.scrolling_items;for(b=a.current;b<a.current+ a.options.visible_items;b++)c+=a.item.eq(b).outerWidth(!0);a.viewport.animate({width:c},600);a.item.animate({left:"-="+d},600);a.item.promise().done(function(){a.next.on("click",p);a.prev.on("click",q)});0<a.current&&a.prev.show();a.current+a.options.visible_items>=a.num_items&&a.next.hide();break;case "yes":for(var f=0,g=[],b=a.current;b<a.current+a.options.scrolling_items;b++){var j=b;b>=a.num_items&&(j=b-a.num_items);d+=a.item.eq(j).outerWidth(!0);g[f]=j;f++}a.current+=a.options.scrolling_items; a.current>=a.num_items&&(a.current-=a.num_items);for(b=a.current;b<a.current+a.options.visible_items;b++)f=b,b>=a.num_items&&(f=b-a.num_items),c+=a.item.eq(f).outerWidth(!0);a.viewport.animate({width:c},600);a.item.animate({left:"-="+d},600);a.item.promise().done(function(){var b=a.item.last().position(),b=b.left+a.item.last().outerWidth(!0);for(k5=0;k5<g.length;k5++)0==g[k5]&&(b=a.item.last().position(),b=b.left+a.item.last().outerWidth(!0)),a.item.eq(g[k5]).css("left",b);a.next.on("click",p);a.prev.on("click", q)})}break;case "vertical":switch(c=d=0,a.options.circular){default:for(b=a.current;b<a.current+a.options.scrolling_items;b++)d+=a.item.eq(b).outerHeight(!0);a.current+=a.options.scrolling_items;for(b=a.current;b<a.current+a.options.visible_items;b++)c+=a.item.eq(b).outerHeight(!0);a.viewport.animate({height:c},600);a.item.animate({top:"-="+d},600);a.item.promise().done(function(){a.next.on("click",p);a.prev.on("click",q)});0<a.current&&a.prev.show();a.current+a.options.visible_items>=a.num_items&& a.next.hide();break;case "yes":f=0;g=[];for(b=a.current;b<a.current+a.options.scrolling_items;b++)j=b,b>=a.num_items&&(j=b-a.num_items),d+=a.item.eq(j).outerHeight(!0),g[f]=j,f++;a.current+=a.options.scrolling_items;a.current>=a.num_items&&(a.current-=a.num_items);for(b=a.current;b<a.current+a.options.visible_items;b++)f=b,b>=a.num_items&&(f=b-a.num_items),c+=a.item.eq(f).outerHeight(!0);a.viewport.animate({height:c});a.item.animate({top:"-="+d});a.item.promise().done(function(){var b=a.item.last().position(), b=b.top+a.item.last().outerHeight(!0);for(k5=0;k5<g.length;k5++)0==g[k5]&&(b=a.item.last().position(),b=b.top+a.item.last().outerHeight(!0)),a.item.eq(g[k5]).css("top",b);a.next.on("click",p);a.prev.on("click",q)})}}k[e]=a;return k},prev:function(c){c=m(c);var a=k[c],b=0,b=0;switch(a.options.orientation){default:var d=0,l=0;switch(a.options.circular){default:a.current-=a.options.scrolling_items;for(b=a.current;b<a.current+a.options.scrolling_items;b++)d+=a.item.eq(b).outerWidth(!0);for(b=a.current;b< a.current+a.options.visible_items;b++)l+=a.item.eq(b).outerWidth(!0);a.viewport.animate({width:l});a.item.animate({left:"+="+d},600);a.item.promise().done(function(){a.prev.on("click",q);a.next.on("click",p)});0>=a.current&&a.prev.hide();a.current+a.options.visible_items<a.num_items&&a.next.show();break;case "yes":var f=0,g=[];a.current-=a.options.scrolling_items;0>a.current&&(a.current+=a.num_items);for(b=a.current;b<a.current+a.options.scrolling_items;b++){var j=b;b>=a.num_items&&(j=b-a.num_items); d+=a.item.eq(j).outerWidth(!0);g[f]=j;f++}for(b=a.current;b<a.current+a.options.visible_items;b++)f=b,b>=a.num_items&&(f=b-a.num_items),l+=a.item.eq(f).outerWidth(!0);b=a.item.first().position();b=b.left-a.wrapper_width;for(k5=0;k5<g.length;k5++)a.item.eq(g[k5]).css("left",b),0==g[k5]&&g[k5-1]==a.num_items-1&&(b=a.item.first().position(),b=b.left-a.wrapper_width,a.item.eq(g[k5-1]).css("left",b));setTimeout(function(){a.viewport.animate({width:l});a.item.animate({left:"+="+d},600);a.item.promise().done(function(){a.prev.on("click", q);a.next.on("click",p)})},200)}break;case "vertical":var h=0,n=0;switch(a.options.circular){default:a.current-=a.options.scrolling_items;for(b=a.current;b<a.current+a.options.scrolling_items;b++)h+=a.item.eq(b).outerHeight(!0);for(b=a.current;b<a.current+a.options.visible_items;b++)n+=a.item.eq(b).outerHeight(!0);a.viewport.animate({height:n});a.item.animate({top:"+="+h},600);a.item.promise().done(function(){a.prev.on("click",q);a.next.on("click",p)});0>=a.current&&a.prev.hide();a.current+a.options.visible_items< a.num_items&&a.next.show();break;case "yes":f=0;g=[];a.current-=a.options.scrolling_items;0>a.current&&(a.current+=a.num_items);for(b=a.current;b<a.current+a.options.scrolling_items;b++)j=b,b>=a.num_items&&(j=b-a.num_items),h+=a.item.eq(j).outerHeight(!0),g[f]=j,f++;for(b=a.current;b<a.current+a.options.visible_items;b++)f=b,b>=a.num_items&&(f=b-a.num_items),n+=a.item.eq(f).outerHeight(!0);b=a.item.first().position();b=b.top-a.wrapper_height;for(k5=0;k5<g.length;k5++)a.item.eq(g[k5]).css("top",b), 0==g[k5]&&g[k5-1]==a.num_items-1&&(b=a.item.first().position(),b=b.top-a.wrapper_height,a.item.eq(g[k5-1]).css("top",b));setTimeout(function(){a.viewport.animate({height:n},600);a.item.animate({top:"+="+h},600);a.item.promise().done(function(){a.prev.on("click",q);a.next.on("click",p)})},200)}}k[c]=a;return k},start:function(e){e=m(e);var a=k[e];0!=a.timer&&clearInterval(a.timer);switch(a.options.direction){default:a.timer=setInterval(function(){a.next.off();a.prev.off();c.fn.als("next",e)},a.options.interval); break;case "right":case "down":a.timer=setInterval(function(){a.prev.off();a.next.off();c.fn.als("prev",e)},a.options.interval)}k[e]=a;return k},stop:function(c){c=m(c);var a=k[c];clearInterval(a.timer);k[c]=a;return k},destroy:function(){c(window).unbind(".als");h=0}};c.fn.als=function(e){if(t[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof e||!e)return t.init.apply(this,arguments);c.error("Method "+e+" does not exist on jQuery.als")}})(jQuery);
Save
Cancel