What I would like to do is dictate where my thumbnails are instead of using the main images as the thumbnail.
I'm pretty sure this can be done, I just need a little push in the right direction.
Here is my Code:
<script type="text/javascript">
$('#imageContainer').before('').cycle({ fx: 'fade', speed: 2000, timeout: 8000, pager: '#nav',
// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(i, slide) {
return '<li><a href="#"><img src="' + slide.src + '" width="121" height="67" /></a></li>';
}
});
And here is the HTML:
<div id="container">
<div id="imageContainer">
<img src="http://www.ifcj.org/ifcj-08/images/elements/slideshow/1.jpg" rel="http://www.ifcj.org/ifcj-08/images/elements/slideshow/1t.jpg" width="378" height="210" />
<img src="http://www.ifcj.org/ifcj-08/images/elements/slideshow/2.jpg" rel="http://www.ifcj.org/ifcj-08/images/elements/slideshow/2t.jpg" width="378" height="210" />
<img src="http://www.ifcj.org/ifcj-08/images/elements/slideshow/3.jpg" rel="http://www.ifcj.org/ifcj-08/images/elements/slideshow/3t.jpg" width="378" height="210" />
</div>
<div id="nav"></div>
Any help would do.
thank You
If you're talking about a scenario like the one described here http://malsup.com/jquery/cycle/pager2.html, you should be able to do something like the following:
pagerAnchorBuilder: function(id, slide) {
var thumb_prefix = "t_";
return '<li><a href="#"><img src="' + thumb_prefix + slide.src + '" width="50" height="50" /></a></li>';
}
This is the simplest example, of course you can do something different depending on your naming convention and particular application, for example inserting a t at the end before the extension:
pagerAnchorBuilder: function(id, slide) {
// Split off the filename with no extension (period + 3 letter extension)
var new_src = slide.src.substring(0,slide.src.length-4);
// Add the "t"
new_src += "t";
// Add the period and the 3 letter extension back on
new_src += slide.src.substring(slide.src.length-4,slide.src.length);
// Set this as the source for our image
return '<li><a href="#"><img src="' + new_src + '" width="50" height="50" /></a></li>';
}