I have a pretty simple problem in jQuery, and I can't seem to find a solution: I have a mouseOver and mouseOut effect, but I need a twist, if click than keep that box open even though their is a mouseOut.
Here's an example of what I have so far :
jsfiddle
Thanks in advance !
To remove the CSS hover effect from a specific element, you can set the pointer-events property of the element (the hover behavior of which you want to disable) to “none”.
preventDefault() within ontouchstart or ontouchend. It appears to stop the hover effect when the button is touched, but it also stops the button click animation and prevents the onclick function from being called when the button is touched, so you have to call those manually in the ontouchstart or ontouchend handler.
The :hover selector is used to select elements when you mouse over them. Tip: The :hover selector can be used on all elements, not only on links. Tip: Use the :link selector to style links to unvisited pages, the :visited selector to style links to visited pages, and the :active selector to style the active link.
If an element is transparent and the element with z-index:-1; is 'under' it. This stops the hover effects. Z-index can you see as elevations in a building, and you watching it from birdseye. You can't reach the basement if there is a floor above it, even if its build from glass.
$(".rock").click(function() {
$('.rock').unbind('mouseout');
});
Unbind the mouseout event at .rock click.
You have to unbind the events, then it stays open forever.
Made you an updated fiddle here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With