diff --git a/app/views/learning_objects/show.html.erb b/app/views/learning_objects/show.html.erb index 6d0809473f9fe3c6d36aa7af460cd00551087e77..8671edd849e48744044e059d03b6f62e80541d58 100644 --- a/app/views/learning_objects/show.html.erb +++ b/app/views/learning_objects/show.html.erb @@ -265,11 +265,12 @@ <!-- /container --> <script type="text/javascript"> - $('.view video').hover(function() { - if (this.hasAttribute("controls")) { - this.removeAttribute("controls") - } else { + $(".view video").hover(function(event) { + if (event.type === "mouseenter") { this.setAttribute("controls","controls") } + else if(event.type === "mouseleave") { + this.removeAttribute("controls") + } }); </script>