Results 1 to 4 of 4

Thread: play / pause button switch

  1. #1
    Join Date
    Dec 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default play / pause button switch

    Hi, thanks in advance for reading this.
    Please visit:
    http://www.cooltester.com/play-pause/siciliano.html
    As you can see, there's a jquery-based photogallery in there.
    It all works ok but the "play" button. I want it to switch to a "pause" button and again to the "play" button at any click. Basically I want the very conventional behaviour for web photogalleries and stuff like that.

    How can that be achieved? Very grateful for any solution. Shall I intervene on the JS code contained in the HTML page? Or in the attached JS file named simplegallery.js ? Of course the "pause" button image is contained in the image folder and it is named "pause.gif" .

    Thank you and may I ask you to specify CLEARLY code spots I should intervene on.

    Cheers,
    G
    Last edited by Snookerman; 05-13-2009 at 03:24 PM. Reason: added “Resolved” prefix

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <html>
    
    <head>
      <title></title>
    <script  type="text/javascript">
    function pp(img){
     if (img.src.indexOf('play')>=0) img.src=img.src.replace('play','pause');
     else img.src=img.src.replace('pause','play');
    }
    </script>
    </head>
    
    <body>
               <li><a href="javascript:mygallery.navigate('playpause')"><img src="imgs/controls/play.gif" onclick="pp(this);"/></a></li>
    
    </body>
    
    </html>

  3. #3
    Join Date
    Dec 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you vwphillips!

  4. #4
    Join Date
    Jul 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi is there a way to make this script also play and pause a embeded wav file

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •