Trishah
04-21-2009, 10:26 PM
1) Script Title: Carousel Slideshow II
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/carousel2.htm
3) Describe problem: I'd like to have a stop/start button on this script. I've been trying to add one and I can't make it work. Any ideas?
Example: http://www.learnwithjenza.com/testimonials.html
jscheuer1
04-22-2009, 05:20 AM
Are you using Carousel Slideshow II:
http://www.dynamicdrive.com/dynamicindex14/carousel2.htm
as you state and link to in your post or Carousel Slideshow:
http://www.dynamicdrive.com/dynamicindex14/carousel.htm
as is used on your example page (testimonials.html)?
Trishah
04-22-2009, 05:53 AM
You are right, I made a mistake. I am using Carousel Slideshow I.
jscheuer1
04-22-2009, 06:13 AM
Not a big deal, but both scripts are complicated and different, so I didn't want to launch into a whole explanation of how to stop one, when you really wanted to know how to stop the other.
Basically the script you are using:
http://www.dynamicdrive.com/dynamicindex14/carousel.htm
works off of the C_Stppd variable. But it is used for pausing the show onmouseover, so we really shouldn't co-opt it.
Let's make our own here (addition highlighted):
/***************** DO NOT EDIT BELOW **********************************/
CW_I=new Array(Car_NoOfSides/2+1);C_ClcW=new Array(Car_NoOfSides/2);
C_Coef=new Array(
3*Math.PI/2,0,3*Math.PI/2,11*Math.PI/6,Math.PI/6,3*Math.PI/2,7*Math.PI/4, 0,
Math.PI/4,3*Math.PI/2,5*Math.PI/3,11*Math.PI/6,0,Math.PI/6,Math.PI/3);
var C_CoefOf=Car_NoOfSides==4?0:Car_NoOfSides==6?2:Car_NoOfSides==8?5:9;
C_Pre_Img=new Array(Car_Image_Sources.length);
var C_Angle=Car_Direction?Math.PI/(Car_NoOfSides/2):0,C_CrImg=Car_NoOfSides,C_MaxW,C_TotalW,
C_Stppd=false,show_stopped=false,i,C_LeftOffset,C_HalfNo=Car_NoOfSides/2;
And add it to the test for C_Stppd here:
function CarImages(){
if(!C_Stppd && !show_stopped){
C_TotalW=0;
for(i=0;i<C_HalfNo;i++){
C_ . . .
Now your stop button can look like so:
<input type="button" onclick="this.value = show_stopped? 'Stop' : 'Start'; show_stopped = !show_stopped;" value="Stop">
Trishah
04-22-2009, 07:05 AM
It's so simple when you know what you are looking for. I did realize that the C_Stppd was the key I just didn't know the right way to tweak it. Thanks for your help!
BTW, are you on Experts-exchange.com? I have an open question about this over there. You could make 500 points if you add your answer there. I'll wait to close that question until I hear from you.
Thanks again! :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.