-2

I want to animate a hover over some elements after some period, but can't seem to get it right.

Here's what i tried.

CODE

$(document).ready(function(){
    function setHover() {
        $('.header_Icons_Main').each(function(i, obj) {
            $(this).mouseenter()
        });
    }
    setInterval(setHover, 1000);
});

Thanks.

user3109875
  • 828
  • 12
  • 35

1 Answers1

-1

If you're trying to trigger a CSS hover (styles defined by something like .header_Icons_Main:hover), unfortunately it looks like you can't do this with JavaScript. See this answer for more info.

You can, however, define a class that adds your desired hover styles and add/remove this class via JS.

function setHover() {
    $('.header_Icons_Main').addClass('hover');
}

Check out this jsfiddle.

Edit: After reading your updated intention to sequentially trigger hover states on each item, I've updated the fiddle here.

Community
  • 1
  • 1
Kylok
  • 767
  • 6
  • 15
  • @user3109875 Did the [updated fiddle](http://jsfiddle.net/9mj9Y/6/) in this answer solve your problem? – Kylok Apr 21 '14 at 22:16