From 32feaefb0b9d4d21591923ecbd4e444933b935c9 Mon Sep 17 00:00:00 2001 From: "luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f" Date: Sun, 27 Jun 2010 18:47:28 +0000 Subject: upfixed bug in slideshow play pause --- media/js/slideshow.js | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'media/js') diff --git a/media/js/slideshow.js b/media/js/slideshow.js index 227efdd..d1b2b93 100644 --- a/media/js/slideshow.js +++ b/media/js/slideshow.js @@ -77,15 +77,24 @@ $(document).ready(function(){ //Add navigation $('#breadcrumbs').after('
'); + + //activate pause button - $('#play').toggle(function() { - $('#slides').cycle('pause'); - $(this).html('▶'); - $(this).attr('title','Play slideshow'); - }, function() { - $('#slides').cycle('resume', true); - $(this).html('▐▐'); - $(this).attr('title','Pause slideshow'); + //state var + var show_state = 'playing'; + $('#play').click(function() { + if (show_state == 'playing') { + $('#slides').cycle('pause'); + $(this).html('▶'); + $(this).attr('title','Play slideshow'); + show_state = 'paused'; + } else { + $('#slides').cycle('resume', true); + $(this).html('▐▐'); + $(this).attr('title','Pause slideshow'); + show_state= 'playing'; + } + return false; }); @@ -148,9 +157,7 @@ $(document).ready(function(){ //if this is a permalink, then pause: if(is_permalink == true) { - $('#slides').cycle('pause'); - $('#play').html('▶'); - $('#play').attr('title','Play slideshow'); + $('#play').click() } //callback to delete map and camera info windows if they exist function onBefore() { -- cgit v1.2.3