|
@@ -64,9 +64,12 @@
|
|
|
var sliderHeight;
|
|
|
if(this.$scrollDir == "Y"){
|
|
|
rate = this.$cont.height() /this.$cont[0].scrollHeight;
|
|
|
- this.$bar.css({
|
|
|
- "top": "0px"
|
|
|
- })
|
|
|
+ if(!this.$bar.css("top")){
|
|
|
+ this.$bar.css({
|
|
|
+ "top": "0px"
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
sliderHeight = rate*this.$bar.height();
|
|
|
this.$slider.css('height',sliderHeight);
|
|
|
}else{
|
|
@@ -75,7 +78,7 @@
|
|
|
"width": "100%",
|
|
|
"height": "5px",
|
|
|
"bottom": "0px",
|
|
|
- "zIndex": "100"
|
|
|
+ "zIndex": "100",
|
|
|
})
|
|
|
this.$slider.css({
|
|
|
"height":"5px"
|
|
@@ -140,7 +143,14 @@
|
|
|
doc.on('mousemove.scroll', mousemoveHandler).on('mouseup.scroll',function(){
|
|
|
doc.off('.scroll');
|
|
|
});
|
|
|
+ self.$cont.on("mouseleave",function(e){
|
|
|
+ e.stopPropagation()
|
|
|
+ doc.off('.scroll');
|
|
|
+ })
|
|
|
});
|
|
|
+ slider.on("click",function(e){
|
|
|
+ e.stopPropagation()
|
|
|
+ })
|
|
|
this.$bar.on("click",function(e){
|
|
|
var scrollHei
|
|
|
dragContBarRate = self.getMaxScrollPosition()/self.getMaxSliderPosition();
|
|
@@ -160,6 +170,7 @@
|
|
|
}
|
|
|
// dragStartScrollPostion = self.$cont[0].scrollTop;
|
|
|
})
|
|
|
+
|
|
|
return self;
|
|
|
}
|
|
|
},
|