2014-02-09 18 views
0

下面的腳本淡入淡出div#1。如果div#1位於名爲testframe的iframe中,您如何從父級調用div?jquery從iframe中淡出

<script> 
document.onmousemove = (function() { 
var onmousestop = function() { 
    $("#1").fadeOut(1000); 
}, thread; 

return function() { 
clearTimeout(thread); 
    thread = setTimeout(onmousestop, 2000); 
    $("#1").fadeIn(500); 
}; 
})(); 
</script> 

感謝, 斯科特

編輯:我要指出的是,同一個域。

回答

0

試試這個:

$("iframe").contents().find("#1").fadeIn(); 
+0

這不是爲我工作。 –