javascript - jQuery delegated mouseenter event only fires on click -
i'm trying wire jquery mouseenter event bunch of links in container. want cancel navigation of link i'm wiring click event. of sudden mouseenter handler executing after clicking link. still mouse enter event because if leave mouse on link, , click again doesn't fire, happens once per entry. if click. nothing happens when move mouse on it. created jsdfiddle try show problem, can't reproduce there. works expected. here's code:
<div> <a name="lnkclasstime" href="#">@classtime.classtimehour</a> </div> wireup:
this.attachschedule = function () { _$classschedules = $("#classschedules"); //..wire other events _$classschedules.on("mouseenter", "a[name='lnkclasstime']", classtimemouseenter); _$classschedules.on("click", "a[name='lnkclasstime']", classtimeclicked); } function classtimeclicked() { //fires when click link } function classtimemouseenter() { //only fires if click link } it must stupid. can figure out happening?
have tried turning off , on again? have. seems have been chrome or chrome developer tools misbehaving. had had browser window , tab open page long time , reusing developed page. despite having refreshed , hard refreshed page, continuing malfunction. guess got out of whack because after closed chrome , reopened it, it's behaving correctly.
edit: seems reproducible setting break point in mouseenter handler, hitting breakpoint, , pressing f5 refresh page while execution paused.
Comments
Post a Comment