0

It's better to show a working example:

The JQuery slider has a functionality I would like to have. When you click on the slider handle and while pressing the mouse button, move the mouse outside the current browser window, the slider handle is still selected. When you release the mouse outside the window, it gets notified and becomes unselected: http://jqueryui.com/demos/slider/

Now I am wondering how a control can be notified when the mouse is released outside the browser window?

AlexStack
  • 16,766
  • 21
  • 72
  • 104
  • Not sure, so not an answer, but maybe it gets unfocussed (wasn't that `onblur()` or something) when you release outside the browser? – Nanne Apr 12 '12 at 09:09
  • onblur happens when user clicks outside the current browser window or goes to another tab. – AlexStack Apr 12 '12 at 09:10

2 Answers2

0

you can try something like

$('#slider').mouseup(function(){    considering #slider is the id of the slider element
    $(this).mouseout(function(){
        //do something
    })
})

does this solve your query?

Sandeep Rajoria
  • 1,243
  • 8
  • 14
  • This code adds a listener for mouseleave() to the slider the first time it mouseup() happens on it. It doesn't remove that handler. How is that supposed to solve this problem? – AlexStack Apr 12 '12 at 10:03
0

I found the answer: the mouse events need to be associated with windowrather than the individual element.

AlexStack
  • 16,766
  • 21
  • 72
  • 104