Mouse down Issue

Posted by 3gwebtrain on Stack Overflow See other posts from Stack Overflow or by 3gwebtrain
Published on 2010-05-19T05:36:31Z Indexed on 2010/05/19 5:40 UTC
Read the original article Hit count: 200

Filed under:

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');

})

})

© Stack Overflow or respective owner

Related posts about onmousedown