Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jquery video gallery, stopping previous video

Status
Not open for further replies.
Aug 23, 2004
174
US
I have a video gallery that lists all of the video links. The player is in a <div> with a unique class name and when a link is clicked that <div> is shows. The problem comes in IE7 and IE6. The videos load fine, but if you click one video then click another, the first continues to play.

Is there a way to stop the first video when the second is clicked?

Here is my jquery code
Code:
<script language="JavaScript" type="text/javascript">	//VIDEO LIBRARY SCRIPT

     $(document).ready(function(){
          $(".center-thmb").click(function(){
          document.getElementById("ru_videoPlayer").stop();
          $("div.active").hide();
          $("div.active").removeClass("active");
          var show = $(this).attr("name");
          $("."+show).show();
          $("."+show).addClass('active');
     })
});
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top