2

Hover function not working inside iFrame.

<script type="text/javascript">
$(function(){
$('.check').live('hover',function(){
alert(0)
})})
</script>

<iframe frameborder="0" allowtransparency="yes" src="frame.html" width="400"></iframe>

//frame html

<a class="check" href="javascript:void"> hover me</a>
Jitender
  • 7,057
  • 25
  • 92
  • 193

1 Answers1

0

IFrame on same domain

I think this is what you are describing...

If your iframe is from the same domain as your code, you can use:

$("iframe").contents().find('.check') as your selector.

IFrame from a different domain

Not possible, please see this question: jQuery/JavaScript: accessing contents of an iframe

Community
  • 1
  • 1
Fiona - myaccessible.website
  • 14,071
  • 15
  • 78
  • 115