wmurmann
wmurmann

Reputation: 115

Is there a way to temporarily disable the mouseover event of an embedded video?

I am using the jQuery resizable plugin to allow users to resize an embedded video. The video is a child of a div which is getting resized. Here is a fiddle of the basics http://jsfiddle.net/jrzNW/1/.

It works fine until the mouse hovers over the the video itself and then the resizing stops until the mouse moves off the video. I tried setting a div to show() when the click event begins but that created more problems then solutions. If someone could point me in the right direction I would appreciate it.

Upvotes: 2

Views: 8666

Answers (1)

pioto
pioto

Reputation: 2592

Well, have you tried something like this?

$('#video').on('mouseover', function() { return false; });

That should abort any other things registered for that event. See .on()

Returning false from an event handler will automatically call event.stopPropagation() and event.preventDefault(). A false value can also be passed for the handler as a shorthand for function(){ return false; }. So, $("a.disabled").on("click", false); attaches an event handler to all links with class "disabled" that prevents them from being followed when they are clicked and also stops the event from bubbling.

Upvotes: 2

Related Questions