#1 2007-11-19 04:07:13
- macmukka
- New member
- Registered: 2007-11-19
- Posts: 1
start at image x as opposed to image 1 without crossfade of goTo?
Hi
I thought that if I changed ehe line in the startSlideShow Function from
this.currentIter = 0;
to
this.currentIter = 2;
that the slideshow would start on image 2.... but it doesnt what do I need to do?
I dont want to use goTo, as this loads the first image and then crossfades, the gallery needs to start on image x rather than fade to it.
Any ideas?
Thanks -
Offline
#2 2008-03-05 15:22:20
- mr_zog
- New member
- Registered: 2008-03-05
- Posts: 2
Re: start at image x as opposed to image 1 without crossfade of goTo?
I want to do this exact thing. Any ideas would be great.
Offline
#3 2008-03-14 20:22:30
- richard_snickers
- New member
- Registered: 2008-03-14
- Posts: 2
Re: start at image x as opposed to image 1 without crossfade of goTo?
I hacked on it a little while and came up with this for starting at a random image. Here is the diff to jd.gallery.js (the line numbers are probably a little wrong since I have done a few other things with my version):
Code:
82,83c82 < customHistoryKey: false, < startNum: 0 --- > customHistoryKey: false 232,234c231,233 < this.lastIter = ((this.options.startNum - 1) + this.galleryData.length) % this.galleryData.length; < this.currentIter = this.options.startNum; < this.galleryInit = 0; --- > this.lastIter = this.maxIter - 1; > this.currentIter = 0; > this.galleryInit = 0; 327c326 < imgPreloader.src = this.galleryData[this.options.startNum].image; --- > imgPreloader.src = this.galleryData[0].image; 329c328 < this.galleryElements[this.options.startNum].load(); --- > this.galleryElements[0].load();
Offline
#4 2008-03-14 20:24:53
- richard_snickers
- New member
- Registered: 2008-03-14
- Posts: 2
Re: start at image x as opposed to image 1 without crossfade of goTo?
1000 chars grumble grumble....
Then, here is how I call the gallery, where the php variable $count is the number of pictures I have:
Code:
var myrand = Math.floor((Math.random()*100000)) % <?php print "$count"; ?>;
var myGallery = new gallery($('myGallery'), {
timed: true,
delay: 10000,
showArrows: false,
showCarousel: false,
startNum: myrand
});So for a fixed starting picture set startNum to a fixed value.
Offline
#5 2008-03-17 13:35:40
- mr_zog
- New member
- Registered: 2008-03-05
- Posts: 2
Re: start at image x as opposed to image 1 without crossfade of goTo?
Thanks - worked exactly how I need to.
I did change the random number var. I used this instead
Code:
var randomnumber=Math.floor(Math.random()*5)
Everything else worked like a charm.
Offline