javascript - .on() jQuery click function won't work? -
i'm trying implement simple click function jsfiddle isn't working.
here javascript/jquery:
$(document).on("click", "#intropic", function () { $("#introduction").addclass("hide") $("#q1").removeclass("hide") }); i don't understand because works if take element in question (#intropic) out of divs nested in , place @ top of document. isn't solution because ruins html/css formatting.
does .on()only work un-nested ids?
here jsfiddle - http://jsfiddle.net/josephbyrne/hdpq4/2/
and here amended version #intropic moved top of html - http://jsfiddle.net/josephbyrne/krudm/
your code fine. problem #introduction put behind body element because of z-index:-99 set on #content container of #introduction. clicking on element in #content click on body element. remove z-index , should work fine.
the interesting thing here background of body should cover #content happens when specify background html element.
Comments
Post a Comment