Hide/show video player buttons .mouseenter() .mouseleave()

Hide/show video player buttons .mouseenter() .mouseleave()

Hello,

As I am new to jquery, does anyone have ideas how to show video player buttons when mouse enters the video container and hide buttons when mouse leaves the container? Only the progress bar should remain on the screen, when mouse leaves. Have tried it with CSS and javascript, but nothing seems to work. I have managed to get to hide/show buttons when mouse is directly at them or leaves, but not when mouse enters the video container.

HTML:

  1. <div id="video_container">
  2. <video id="video">
  3. <source src="video/video_new.mp4" type="video/mp4">
  4. <source src="video/video_new.ogg" type="video/ogg">
  5. </video>
  6. <!-- Video Controls -->
  7. <div id="video-controls">
  8.     <button type="button" class="button" id="play-pause"><input type="image" src="icons/play-icon.png" alt="play button icon"></button>
  9.     <button type="button" class="button" id="mute"><input type="image" src="icons/volume-on-icon.png" alt="volume ON icon"></button>
  10.     <button type="button" class="button" id="full-screen"><input type="image" src="icons/fullscreen-icon.png" alt="fullscreen button icon"></button>
  11.     <div><span id="currentTime">00:00</span></div><span id="slash">/</span><div id="duration"><span>00:00</span></div>
  12.   </div>
  13.      <progress id="progress" value="0">
  14.          <span id="progress-bar"></span>
  15.       </progress>
  16.   </div>