2011-09-07 88 views
0

全部,iframe滾動事件在Chrome中監聽

我有兩個圖像(SVG),我想要在iframe中「固定位置」。不幸的是,固定位置的CSS屬性在這裏不起作用,所以我試圖用js來完成。

這裏是監聽iframe的滾動運動的代碼,我使用它來移動iframe中的圖像(SVG)。不幸的是,這在Chrome中無法使用。任何指導請。

window.onload = function(){ var f = document.getElementById(「iframe_id」)。contentWindow; frm.onscroll = movef; }

function movef (evt) { 
    alert ("hello"); 
} 

回答

0

文檔lang在chrome中略有不同。 contentWindow將是contentDocument in chrome