Is there any way to hover over one element and affect a different element? [duplicate]

The only way to do this with CSS is if the element to affect is either a descendent or an adjacent sibling. In the case of a descendent: #parent_element:hover #child_element, /* or */ #parent_element:hover > #child_element { opacity: 0.3; } Which will apply to elements such as: <div id=”parent_element”> <div id=”child_element”>Content</div> </div> For adjacent siblings: … Read more

Combine hover and click functions (jQuery)?

Use basic programming composition: create a method and pass the same function to click and hover as a callback. var hoverOrClick = function () { // do something common } $(‘#target’).click(hoverOrClick).hover(hoverOrClick); Second way: use bindon: $(‘#target’).on(‘click mouseover’, function () { // Do something for both }); jQuery(‘#target’).bind(‘click mouseover’, function () { // Do something for … Read more

Hover on child should turn off hover effect on parent [duplicate]

Basically you can’t : How to style the parent element when hovering a child element? But a trick is to use a sibling element : http://jsfiddle.net/k3Zdt/8/ .parent { width: 100px; height: 100px; padding: 50px; } .child { height: 100px; width: 100px; background: #355E95; transition: background-color 1s; position: relative; top: -200px; } .child:hover { background: #000; … Read more

React event onMouseLeave not triggered when moving cursor fast

seems to be an issue caused by event delegation when the event listener is on the parent element and child elements are being conditionally added/removed from the DOM. putting a “hover target” component that sits on top of everything should make this work properly, but could cause other issues if you need to click elements … Read more

How to tell .hover() to wait?

This will make the second function wait 2 seconds (2000 milliseconds) before executing: $(‘.icon’).hover(function() { clearTimeout($(this).data(‘timeout’)); $(‘li.icon > ul’).slideDown(‘fast’); }, function() { var t = setTimeout(function() { $(‘li.icon > ul’).slideUp(‘fast’); }, 2000); $(this).data(‘timeout’, t); }); It also clears the timeout when the user hovers back in to avoid crazy behavior. This is not a very … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)