Question

I am using the Jquery Cycle plugin here that uses the images on the slider to create thumbnails, eg:

$('#slideshow').before('<ul id="nav">').cycle({ 
    fx:     'turnDown', 
    speed:  'fast', 
    timeout: 0, 
    pager:  '#nav', 

    // callback fn that creates a thumbnail to use as pager anchor 
    pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#"><img src="' + slide.src + '" width="50" height="50" /></a></li>'; 
    } 
});

this takes whatever element is in slide.src and converts it to am image thumbnail. However, I want to have my sliding images as links as well. If I am to wrap them in <a> tags, however, this would break the thumbnail images.

Would anyone know how to alter this script to allow for a tags?

Was it helpful?

Solution

The only way I could achieve this was doing it by retroactively wrapping the images in an a tag:

  $("#frontimageswap img:nth-child(1)").wrap("<a href='http://www.google.com' />");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top