keithclark / selectivizr

selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.
1.71k stars 247 forks source link

hover broken for newly loaded dom elements #16

Closed jessehart closed 13 years ago

jessehart commented 13 years ago

in ie7 (could be ie6+ie8 as well) selectivizr seems to break the hover states for ajax loaded dom elements

jquery 1.6.1, selectivizr 1.0.3b (and lower)

keithclark commented 13 years ago

Do you have an online example I can look at?

jessehart commented 13 years ago

conflict with something else, not sure yet

keithclark commented 13 years ago

If you get to the bottom of it could you let me know what the problem was?

skrivle commented 11 years ago

This one is still an active issue.

The problem occurs when new elements are added to the DOM after selectivizr has initialized.

The script removes all the :hover rules from the css file and replaces them with a class like .hover or something. Then Selectivizr binds an event handler that toggles this class on and off to all of the elements that match the given selector. The problem is that for all elements generated by javascript there isn't such an event handler available and thus the .hover class will not be toggled on and off. As a result no hover effect will be shown.

A solution could be making use of event delegation although I'm not sure what that would mean performance wise ...

johndugan commented 10 years ago

I am experiencing the same issue with Selectivizr and the :hover event. Any update on this? Currently running version 1.0.3b.

aokros commented 10 years ago

This issue is still present. Do you need some help in resolving? We are trying to use selectivizr in an SPA that runs on Angular.js, but this defect makes it impossible...