PHP Classes

File: public/flat-admin/js/plugins/slimscroll/jquery.slimscroll.min.js

Recommend this page to a friend!
  Classes of adriano123456   Budget System   public/flat-admin/js/plugins/slimscroll/jquery.slimscroll.min.js   Download  
File: public/flat-admin/js/plugins/slimscroll/jquery.slimscroll.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Budget System
Elaborate budgets for purchases of products
Author: By
Last change:
Date: 15 days ago
Size: 4,340 bytes
 

Contents

Class file image Download
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Version: 1.1.1 * */(function(e){jQuery.fn.extend({slimScroll:function(t){var n={width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200},r=e.extend(n,t);this.each(function(){function S(t){if(!n)return;var t=t||window.event,i=0;t.wheelDelta&&(i=-t.wheelDelta/120);t.detail&&(i=t.detail/3);var s=t.target||t.srcTarget;e(s).closest("."+r.wrapperClass).is(v.parent())&&x(i,!0);t.preventDefault&&!d&&t.preventDefault();d||(t.returnValue=!1)}function x(e,t,n){var i=e,s=v.outerHeight()-w.outerHeight();if(t){i=parseInt(w.css("top"))+e*parseInt(r.wheelStep)/100*w.outerHeight();i=Math.min(Math.max(i,0),s);i=e>0?Math.ceil(i):Math.floor(i);w.css({top:i+"px"})}l=parseInt(w.css("top"))/(v.outerHeight()-w.outerHeight());i=l*(v[0].scrollHeight-v.outerHeight());if(n){i=e;var u=i/v[0].scrollHeight*v.outerHeight();u=Math.min(Math.max(u,0),s);w.css({top:u+"px"})}v.scrollTop(i);v.trigger("slimscrolling",~~i);C();k()}function T(){if(window.addEventListener){this.addEventListener("DOMMouseScroll",S,!1);this.addEventListener("mousewheel",S,!1)}else document.attachEvent("onmousewheel",S)}function N(){f=Math.max(v.outerHeight()/v[0].scrollHeight*v.outerHeight(),p);w.css({height:f+"px"});var e=f==v.outerHeight()?"none":"block";w.css({display:e})}function C(){N();clearTimeout(u);if(l==~~l){d=r.allowPageScroll;if(c!=l){var e=~~l==0?"top":"bottom";v.trigger("slimscroll",e)}}else d=!1;c=l;if(f>=v.outerHeight()){d=!0;return}w.stop(!0,!0).fadeIn("fast");r.railVisible&&b.stop(!0,!0).fadeIn("fast")}function k(){r.alwaysVisible||(u=setTimeout(function(){if((!r.disableFadeOut||!n)&&!i&&!s){w.fadeOut("slow");b.fadeOut("slow")}},1e3))}var n,i,s,u,a,f,l,c,h="<div></div>",p=30,d=!1,v=e(this);if(v.parent().hasClass(r.wrapperClass)){var m=v.scrollTop();w=v.parent().find("."+r.barClass);b=v.parent().find("."+r.railClass);N();if(e.isPlainObject(t)){if("height"in t&&t.height=="auto"){v.parent().css("height","auto");v.css("height","auto");var g=v.parent().parent().innerHeight();v.parent().css("height",g);v.css("height",g)}if("scrollTo"in t)m=parseInt(r.scrollTo);else if("scrollBy"in t)m+=parseInt(r.scrollBy);else if("destroy"in t){w.remove();b.remove();v.unwrap();return}x(m,!1,!0)}return}r.height=r.height=="auto"?v.parent().innerHeight():r.height;var y=e(h).addClass(r.wrapperClass).css({position:"relative",overflow:"hidden",width:r.width,height:r.height});v.css({overflow:"hidden",width:r.width,height:r.height});var b=e(h).addClass(r.railClass).css({width:r.size,height:"100%",position:"absolute",top:0,display:r.alwaysVisible&&r.railVisible?"block":"none","border-radius":r.size,background:r.railColor,opacity:r.railOpacity,zIndex:90}),w=e(h).addClass(r.barClass).css({background:r.color,width:r.size,position:"absolute",top:0,opacity:r.opacity,display:r.alwaysVisible?"block":"none","border-radius":r.size,BorderRadius:r.size,MozBorderRadius:r.size,WebkitBorderRadius:r.size,zIndex:99}),E=r.position=="right"?{right:r.distance}:{left:r.distance};b.css(E);w.css(E);v.wrap(y);v.parent().append(w);v.parent().append(b);r.railDraggable&&w.draggable({axis:"y",containment:"parent",start:function(){s=!0},stop:function(){s=!1;k()},drag:function(t){x(0,e(this).position().top,!1)}});b.hover(function(){C()},function(){k()});w.hover(function(){i=!0},function(){i=!1});v.hover(function(){n=!0;C();k()},function(){n=!1;k()});v.bind("touchstart",function(e,t){e.originalEvent.touches.length&&(a=e.originalEvent.touches[0].pageY)});v.bind("touchmove",function(e){e.originalEvent.preventDefault();if(e.originalEvent.touches.length){var t=(a-e.originalEvent.touches[0].pageY)/r.touchScrollStep;x(t,!0)}});if(r.start==="bottom"){w.css({top:v.outerHeight()-w.outerHeight()});x(0,!0)}else if(r.start!=="top"){x(e(r.start).position().top,null,!0);r.alwaysVisible||w.hide()}T();N()});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);