Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hover.leave != 0 prevents hover of next element with same selector #63

Closed
iamnoah opened this issue Nov 27, 2012 · 0 comments
Closed

hover.leave != 0 prevents hover of next element with same selector #63

iamnoah opened this issue Nov 27, 2012 · 0 comments

Comments

@iamnoah
Copy link
Contributor

@iamnoah iamnoah commented Nov 27, 2012

Using the hover plugin on multiple elements matching the same selector. Setting any leave prevents the next element from ever being hovered until you mouseover another element. e.g., If you start on an even, only the evens will hover.

var Foo = can.Control({
    ".item hoverinit": function(el,ev,hover){
        hover.leave(300);
    },
    ".item hoverenter": function(el) {
        el.addClass("active");
    },
    ".item hoverleave": function(el) {
        el.removeClass("active");
    }
});

new Foo(".test-foo");
<div class="test-foo">
    <ol>
        <li class="item">1
        <li class="item">2
        <li class="item">3
        <li class="item">4
    </ol>
</div>

Demo: http://jsfiddle.net/AXwHG/

@daffl daffl closed this in 667b07d Feb 6, 2013
daffl added a commit that referenced this issue Feb 6, 2013
Force hover leave on new mouseenter. Fixes #63 and #64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.