javascript - Mouseover on all elements in frame only responds to click -


i'm trying apply handler elements inside iframe (that on same domain) , can't figure out why function fires on click. fear may have fact iframe active when i'm clicking it. have seen applications of in jsfiddle such http://jsfiddle.net/danmana/pmbw2/

this code (i tried mimicking jsfiddle using delegate function , got same results):

            $('iframe').contents().on("mouseover", "*", function() {                  $(this).css("background-color", "yellow");             }); 

edit working jsfiddle (http://jsfiddle.net/danmana/pmbw2/) found if switch newest version of jquery 2.1.0, code no longer works, seems 1.8.3 newest 1 works code.

this works me -

var $c = $('iframe').contents(); $c.delegate('div', 'hover', function() {     $(this).css("background-color", "yellow"); }); 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -