View Full Version : Resolved play / pause button switch

05-07-2009, 12:02 AM
Hi, thanks in advance for reading this.
Please visit:
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.


05-07-2009, 08:03 AM

<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');

<li><a href="javascript:mygallery.navigate('playpause')"><img src="imgs/controls/play.gif" onclick="pp(this);"/></a></li>



05-13-2009, 02:50 PM
Thank you vwphillips!

07-25-2010, 02:50 PM
Hi is there a way to make this script also play and pause a embeded wav file