Ryan Weiss Ryan Weiss - 1 year ago 110
Javascript Question

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

Trying to hide and show the video controls on hover enter / hover leave:

$('#content-video').hover(function(event) {
if(event.type === "mouseenter") {
$(this).attr("controls", true);
} else if(event.type === "mouseleave") {
$(this).attr("controls", false);
$(this).prop("controls", false);

Have tried everything. The ENTER and EXIT messages show properly, as expected, in Internet explorer, but the 'controls="true"' stays on the element and the controls stay visible on mouseleave! Any ideas why? Grumble.

Answer Source
document.getElementById("myVideo").controls = false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download