Reputation: 11215
http://jsfiddle.net/nicktheandroid/GPFxM/28/
I've also explained the situation in the JS Fiddle example.
I binded hover and mousemove, but when unbinding them, i have to ALSO unbind mouseenter and mouseleave to get it to work a little better, but still it doesn't work correctly.
I changed the cursor to Pointer in the hover bind, but when unbinding it I thought the cursor would go back to normal, but it doesn't?
My plugin adds a 'cursor image', which is an image that follows the cursor around when hovering over specific elements. I made a div that has a cursor image when hovering this div, when clicking on the div it unbinds the hover, which should unbind the cursor image, what happens though is that the cursor image sticks to the box, and doesn't fade out like it should.
I just need help getting this straightened out and if you could explain to me what I did wrong, that would be greatly appreciated, thanks so much.
Upvotes: 0
Views: 112
Reputation: 20371
unbind
only takes one event at a time, so your code only ever unbinds mouseover
.hover
simply binds both mouseenter
and mouseleave
.$('#tehCursor').fadeOut('fast');
to the click handlers for the disable span and .myBox
, you should see it work like what I think you expect.Update
My first ever jQuery plugin; I can't claim to understand it all and it probably isn't the most efficient since I basically took the code in this tutorial and adapted it to your needs. This fiddle should be what you're looking for.
Upvotes: 1