jquery - problem with mouse event for absolute position div -
I have a list of images on mouseover, some information is visible on them. The problem is that the trigger for the mouse event notification is not.
#team_div {display: block; Status: Relative; #pop_div {width: 300px; Padding: 5px; Height: 200px; Hidden flurry; Border: 2px solid # ccc; Background: #fefefe; Status: Completed; display none; #pop_div img {margin: 10px; Display area; Swim left; }
.
& lt; Div id = "team_div" class = "team_div_loading" & gt; & Lt; Div id = "pop_div" & gt; & Lt; / Div & gt; & Lt; Table & gt; List of images & lt; / Table & gt; & Lt; / Div & gt;
.
$ ('# team_div' table img '). Hover (function () {var top = this.parentNode.offsetTop; var left = this.parentNode.offsetLeft; var img = $ (this) .attr ('src'); var id = $ (this) .attr (' Id '); var content = $ ("#" + id + "$ (" # Pop_div "). $ (" # Pop_div "). CSS (' top ', top-11 +' px '); $ (" $ ("('Left', left-12 + 'px'); $ (" #p_dive ") $ (" & lt; img src = "'+ + img +'" / & gt; '+ content) Pop_div "#pop_div") .FadeIn (700);}); $ ("# pop_div"). Mouseout (function () {$ ("this"). Hide ();});
In this, if the sound is called for an image on the hover, then no mouse events are being triggered for pop_div.
.
First of all, you can not use it in the element, for this a div or Ul li structure, I have done that, insert img tag
< Edit the jquery function with / pre> and
$ ('# team_div & gt; .imageDiv img'). Hover (function () {var top = this Parent.Node.offsetTop; var left = this.parentNode.offsetLeft; var img = $ (this) .attr ('src'); var id = $ (this) .attr ( Css ('top', top-11 + 'px'); $ ("#pop_div") CSS ('left', left- $ 12 ("# pop_div"). Html ('& lt; img src = "' + + img +" "/"; + content); $ ("# pop_div"). 700);});
You were just using an incorrect jQuery selector. I do not know what you are trying to do with the image hover function, but it Working with the above changes
Comments
Post a Comment