Open GoogleCodeExporter opened 8 years ago
Yes! Thanks for the great script. But i would like to have something similiar
as suggested by LaposInfernafalis. It would be great if you could pass a
variable dynamically that indicates what slide to start with.
G
Original comment by sventro...@gmail.com
on 14 Sep 2011 at 5:49
[deleted comment]
[deleted comment]
I have found a workaround for this problem.
I have tabs like this:
<a href="javascript:" rel="tab-1" class="carousel-jumper" id="slide1">Slide
1</a>
<a href="javascript:" rel="tab-2" class="carousel-jumper carousel-selected"
id="slide2">Slide 2</a>
<a href="javascript:" rel="tab-3" class="carousel-jumper" id="slide3">Slide
3</a>
From line 68 on, I have replaced the "if (this.options.initial) {"-condition in
carousel.js with the following code:
var tab = 'tab-1';
if(document.getElementById("slide1").className == 'carousel-jumper
carousel-selected') { tab = document.getElementById("slide1").rel };
if(document.getElementById("slide2").className == 'carousel-jumper
carousel-selected') { tab = document.getElementById("slide2").rel };
if(document.getElementById("slide3").className == 'carousel-jumper
carousel-selected') { tab = document.getElementById("slide3").rel };
this.options.duration = 0;
this.moveTo(tab);
this.options.duration = 1;
Hope that helps!
-Christian Gersch
Original comment by use...@christian-gersch.de
on 23 Sep 2011 at 3:42
[deleted comment]
Thanks Christian! I'm totally not into Prototype but wouldn't it be much easier
to do something like this in prototype:
Get the element of the ID of the Slide that has the classname
'carousel-selected' and then set the variable tab to this Element? so you don't
need to create an if statement for all your slides.
Maybe we could use getElementByClassName or just an .hasClassname
carousel-selected...
Original comment by sventro...@gmail.com
on 26 Sep 2011 at 12:44
Original issue reported on code.google.com by
spasemac...@googlemail.com
on 24 Jul 2011 at 5:30