的index.html <object id="battle" data="battle.html"></object>
的Html <object>,從外面
有一個動畫我想告訴讀的JavaScript檢測,但在動畫芬蘭我希望它關閉。 我試圖做的網頁消失,它的工作,但它後屏幕是無法點擊
battle.html document.getElementById("battlebody").style.display="none";
!The image!當動畫完成此代碼播放。基本上,我在它周圍做了一個邊框,告訴它在隱身的同時。
那麼我想知道是否有可能編輯index.html中的<object>
標記,而不是像我所做的那樣在battle.html中編輯。
爲例 的index.html
<body>
<object id="battle" data="battle.html"></object>
</body>
的battle.html
<body>
<button id="" onclick="closing(); ">close</button>
<script>
function closing() {
window.close()
</script>
</body>
我還挺想使物體接近,但它不工作的方式,從而使物體display:none;
但爲此,您需要將該js代碼添加到index.html,但index.html不會讀入<object>
做出小提琴PLS .. –
@Bla ......不能因爲只有小提琴使用1個html頁面。 – Bamuel
'object id =「battle」'...'document.getElementById(「battlebody」)。style.display =「none」;'......兩個不同的ID ......爲什麼?你有沒有試過'document.getElementById(「battle」)。style.display =「none」;' –