This is a message.

Slideshow plugin - Dynamic interval Created Nov 4, 2009

This thread is solved

Views: 5089     Replies: 7     Last reply Feb 24, 2011  
You must login first before you can use this feature

vmr

Posts: 6

Registered:
Oct 13, 2009

Slideshow plugin - Dynamic interval

Posted: Nov 4, 2009

I am using slideshow plugin. Trying to have value for the 'interval' attribute from a variable. I searched in the forums but could not find anything related.

Here is my code which does not take into account 'chosen_time_interval' variable set while running 'onBeforePlay' method.

$("div.tabs").tabs(".images > div", {
//load content through ajax
effect: 'ajax',
// start from the beginning after the last tab
rotate: true
// use the slideshow plugin. It accepts its own configuration
}).slideshow({
onBeforePlay: function(){
var chosen_time_interval = $("#time_interval").val()*1000;
},
clickable: false,
autoplay:false,
interval: chosen_time_interval //value 5000 or any works
});

My Play and Stop buttons are as follows.

<button onClick='$("div.tabs").tabs().play();'>Play</button>
<button onClick='$("div.tabs").tabs().stop();'>Stop</button>

Thanks for your help.

vmr

Posts: 6

Registered:
Oct 13, 2009

» Slideshow plugin - Dynamic interval

Posted: Nov 4, 2009

Reply to: Slideshow plugin - Dynamic interval, from vmrao
Is this forum alive ? I posted another thread yesterday and not even a single response yet. Can anyone please help.

vmr

Posts: 6

Registered:
Oct 13, 2009

» » Slideshow plugin - Dynamic interval

Posted: Nov 4, 2009

Reply to: » Slideshow plugin - Dynamic interval, from vmrao
I found the following thread where it says interval parameter can be updated dynamically on the scrollable tab using the code such as

http://flowplayer.org/tools/forum/35/20400

$(".scrollable").scrollable().getConf().interval = 0;

Is there any similar code for slideshow plugin ? I tried as follows but no luck.

$("div.tabs").tabs(".images > div").slideshow().getConf().interval

It looks like it is possible to update the interval parameter for tabs slideshow but I am not able to figure out how. Can anyone point me in the right direction. Thanks.

MacBee
I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools Wink

Posts: 8

Registered:
Aug 5, 2009

» » » Slideshow plugin - Dynamic interval

Posted: Nov 13, 2009

Reply to: » » Slideshow plugin - Dynamic interval, from vmrao
You can try this configuration :

effect: 'ajax',
fadeInSpeed: 200,
fadeOutSpeed: 1000,
interval: 5000,

tonny

Posts: 1

Registered:
Dec 14, 2009

Its work

Posted: Dec 14, 2009

Reply to: Slideshow plugin - Dynamic interval, from vmrao
Its work but you need to enable autoplay:true,

or read the documentation

This option(interval) is valid only when autoplay is enabled or the play() method is called.

peace

hahaha

Posts: 11

Registered:
Apr 18, 2010

» Its work

Posted: May 11, 2010

Reply to: Its work, from tonny
ARE YOU SURE ???
did you try that yourself or is it just a guess? Because I have

$(function() {

$(".slidetabs").tabs(".images > div", {

// enable "cross-fading" effect
effect: "fade",
fadeOutSpeed: 1500,
fadeInSpeed: 1100,
interval: 8000,

// start from the beginning after the last tab
rotate: true

// enable autoplay
}).slideshow({autoplay: true});
});

And my word ... the interval doesn't work! But the following works:

$(function() {

$(".slidetabs").tabs(".images > div", {

// enable "cross-fading" effect
effect: "fade",
fadeOutSpeed: 1500,
fadeInSpeed: 1100,

// start from the beginning after the last tab
rotate: true

// set autoplay loop
}).slideshow({autoplay: true, interval: 8000});
});

Kinda logic to add the loop to autoplay! Just figured it out myself and I have no clue about jQuery or javascripting at all ;-)

fkfouri

Posts: 1

Registered:
Jan 28, 2011

» » Its work

Posted: Jan 28, 2011

Reply to: » Its work, from hahaha
The follow buttons change the interval

<button onclick='$(".slidetabs").data("slideshow").stop();$(".slidetabs").slideshow().getConf().interval = 5000;$(".slidetabs").data("slideshow").play();'>5 seconds Interval</button>

<button onclick='$(".slidetabs").data("slideshow").stop();$(".slidetabs").slideshow().getConf().interval = 1000;$(".slidetabs").data("slideshow").play();'>1 second Interval</button>

Jared Ritchey
http://jaredritchey.com

Posts: 1

Registered:
Aug 5, 2009

» » Its work

Posted: Feb 24, 2011

Reply to: » Its work, from hahaha
Yep it is exactly as you outlined. In fact its the only way that works with the auto feature.

Oh yeah and add this little doooodad if conflicts are an issue as it was in my situation.

<script type="text/javascript">
var $j = jQuery.noConflict();
$j(function() {
	$j("ul.thetabs").tabs("div.panes > div", {
	effect: 'fade',
	//fadeOutSpeed: "slow",
	fadeInSpeed: 1000,
	fadeOutSpeed: 1000,
	rotate: true
	}).slideshow({autoplay: true, interval: 8000});
});
</script>