I have a webpage with several instances of the following code snippet wrapped in <div id="result">
tags:
<div id="result"><a href="http://www.domain.com/">Link Name</a><iframe src="http://www.domain.com/" style="width:285px;height:285px;border:0px;margin:0px" scrolling="no"></iframe></div>
Currently, I am utilizing jQuery to display the <a>
tag when hovering over an iframe element:
$(document).ready(function(){
$('#result iframe').hover(function(){
$('#result a').fadeIn(200);
},function(){
$('#result a').fadeOut(200);
});
});
However, this implementation only works for the first <div id="result">
, and it displays the <a>
tags for all <div id="result">
elements instead of just the one being hovered over. How can I resolve this issue?