Forums

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 topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #39913
    ChristyM
    Participant

    This is the website I am working on:

    http://rebeccakush.com/

    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?

    #110317
    Taufik Nurrohman
    Participant

    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+'">');
    });
    });
    #110336
    ChristyM
    Participant

    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. : )

    #110516
    ChristyM
    Participant

    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?

    #110537
    djrolstad
    Participant

    put it within the body tags and put it in a script tag

    #110549
    ChristyM
    Participant

    Thanks djrolstad. That helped.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.