2016-09-24 1 views
1

ホバー/ホバー休暇を入力してください上のビデオコントロールを非表示と表示するようにしようとは:HTML5ビデオ:コントロールを非表示にすると、Internet Explorerで動作しません、removeAttr、removePropなど

$('#content-video').hover(function(event) { 
    if(event.type === "mouseenter") { 
     console.log("ENTER"); 
     $(this).attr("controls", true); 
    } else if(event.type === "mouseleave") { 
     console.log("EXIT"); 
     $(this).attr("controls", false); 
     $(this).prop("controls", false); 
     $(this).removeAttr("controls"); 
     $(this).removeProp("controls"); 
     currentVideo.removeAttribute('controls'); 
    } 
}) 

は、すべてのものを試してみました。 EnterとEXITメッセージはInternet Explorerでは正常に表示されますが、 'controls = "true"'は要素に残り、コントロールはmouseleave上に表示されたままになります。なぜどんなアイデア?不平を言う。

+0

IEのどのバージョン? – Rado

+1

あなたは.control-バーを試すことができます{ 表示:なし; } .control-barは、ビデオプレーヤーのコントロールのクラスです。別のオプションはdocument.getElementById( "myVideo")です。controls = false; – Rado

+1

IE11。 document.getElementByIdが機能しました。ラドーに感謝します。 –

答えて

3
document.getElementById("myVideo").controls = false; 
関連する問題