Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Mootools Mouseenter from firing on hidden child elements

I have a content slider that auto rotates that when you hover over it it will stop rotating. My problem is this bit of code here:

$$('.holder').addEvents({
    mouseover: function(){
        clearInterval(rollingon);
    },
    mouseout: begin
});

HTML:

<div id="fliptable">
    <div class="holder">
    <ul class="headliner" style="left: 0;">
        <li class="headitem">
            <div class="squared" style="opacity: 1;">
                            *content*
            </div>
        </li>
    </ul>
    </div>
</div>

Fliptable expands the full width of the browser. So the different list elements have their opacity changed as it goes. Now my problem is mouseover will fire when I'm hovering over the hidden list elements. Is there anyway I can not have it fire on children?

Here is the JS fiddle: http://jsfiddle.net/AjWuL/

like image 258
Neal Carroll Avatar asked Mar 05 '11 13:03

Neal Carroll


1 Answers

yes, you can just add another class to the list elements you dont want to react to the even and do something like this

window.onmouseover=function(e){
if(e.target.className!="hiddenelements"){
what you want 
}

you have to adapt this to your code, i dont know how to put this in your class on jsfiddle.

like image 196
nope Avatar answered Nov 08 '22 11:11

nope