- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Trouble Linking Thumbnails to Javascript Slider
This is the website I am working on:
I want to turn those little brown boxes (which were generated by the javascript) into thumbnail images.
I don’t know javascript and I can’t figure out how I would connect the thumbnail images to the slider.
Can anyone help?
This script is combined outside the plugin. But, yeah… this can be an alternative ⇒ http://jsfiddle.net/tovic/43eG7/11/
$(function() {
$('#slides').slides({
preload: true,
generateNextPrev: true
});
// Your thumbnails here...
var thumbnails = [
"http://lorempixel.com/50/50/sports/1",
"http://lorempixel.com/50/50/sports/2",
"http://lorempixel.com/50/50/sports/3",
"http://lorempixel.com/50/50/sports/4"
];
$('#slides .pagination a').each(function(i) {
$(this).html('<img alt="thumbnail" src="'+thumbnails+'">');
});
});
Hompimpa – Thank you immensely! I am checking out your two versions. I never would have figured this out, but now I might even learn something about Javascript. : )
I ran into some trouble when I tried to implement your code. I wasn’t 100% sure where your javascript was supposed to go so first I tried it between the script tags on my html page. It generated many many boxes and an unresponsive script. I reverted the html page back to how it was before and tried putting your javascript at the top of slides.jquery.js, but I ended up getting the same ‘unresponsive script’. Any idea what I am dong wrong?
put it within the body tags and put it in a script tag
Thanks djrolstad. That helped.