Mouse down Issue
HI,
I am making my own scroll bar. in which i made this code below i pasted. i am getting the issue from this code.
i) in the first time i am pressing "#scroller" that works fine.
ii) in case of second or other time when i am enter into "#scroller" itself, i am getting the alert "hi", instead of i am pressing the "#scroller", i know that i am doing some wrong this with my code, but i unable to find the mistake.
Any one help me?
$(function(){ var slidesWidth = ($('#show-content li').length)*($('#show-content li').width()+20);
$('#show-content ul').width(slidesWidth);
var scrollBarWidth = (100/slidesWidth)*1000;//presently taken by manual/
$('#scroller').width(scrollBarWidth);
$('#scroller').bind('mousedown',function(){
$('#scroller').mousemove(function(){
alert('hi');
开发者_Go百科 })
})
$('#scroller').bind('mouseup',function(){
$('#scroller').unbind('mousedown,mousemove');
alert('unbinded');
})
})
#scroller
's mousemove
event may not have been unbound. Try this when you unbind
.
$('#scroller').unbind('mousedown').unbind('mousemove');
精彩评论