Note that there are some explanatory texts on larger screens.

plurals
  1. POIn between parent and iframe: mouseover/out combined with click behavior
    text
    copied!<p>I am very new in programming. Please give me a mercy. According to the post <a href="https://stackoverflow.com/questions/14828995/javascript-mouseover-out-combined-with-click-behavior">mouseover/out combined with click behavior </a>. I would like to ask further question since I still cannot achieve the task. </p> <p>Here below is my code:</p> <p><strong>Child.html</strong></p> <pre><code>&lt;div id="custom_div"&gt;This div will be highlighted&lt;/div&gt; </code></pre> <p><strong>Parent.html</strong></p> <pre><code>&lt;iframe id="iframeID" src="Child.html"&gt;&lt;/iframe&gt; &lt;a href="#" id="custom_Link"&gt;Click to highlight the custom div in Child.html&lt;/a&gt; &lt;script&gt; $('#iframeID').contents().find('#custom_div'); $('#custom_Link').hover(function () { $('#custom_div').toggleClass('highlight'); }); $('#Custom_Link').click(function (e) { $('#Custom_div').addClass('highlight'); $(e.currentTarget).unbind('mouseenter mouseleave'); }); &lt;/script&gt; </code></pre> <p>What I want to do is:</p> <ol> <li>when the user <strong>hovers mouse</strong> on "custom_link", the "custom_div" is being highlighted.</li> <li>when the user <strong>moves mouse out off</strong> "custom_link", the highlight at "custom_div" is eliminated.</li> <li>when the user <strong>clicks</strong> at "custom_link", "custom_div" is being highlight. However, when the user moves mouse out, the 'highlightDiv' is still being added to "custom_div".</li> </ol> <p>Could you please help me to dissolve this? I sought a lot of "accessing iframe element by Jquery" issue ,however, I still cannot understand. It would be very nice if you could provide Jsfiddle example as well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload