簡體   English   中英

HTML5視頻:隱藏控件在Internet Explorer,removeAttr,removeProp等中不起作用

[英]HTML5 Video: Hiding controls does not work in internet explorer, removeAttr, removeProp, etc

嘗試在懸停時隱藏和顯示視頻控件進入/懸停離開:

$('#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上保持可見! 有什么想法嗎? 嘰。

document.getElementById("myVideo").controls = false;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM