Mouse down Issue
- by 3gwebtrain
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');
})
})
$('#scroller').bind('mouseup',function(){
$('#scroller').unbind('mousedown,mousemove');
alert('unbinded');
})
})