问题
I've got some code here for a slideshow that I need to add links to, it is a JavaScript image array that works fine but I am not sure how to add links to each picture.
I'm very newbie with JS.
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [200, 235], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images_ads/image1.jpg"],
["images_ads/image2.jpg"],
["images_ads/image3.jpg"]
],
displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})
回答1:
According to Dynamic Drive, the second key in the image array should be your URL value and the third value is the text you want to display For instance:
["images_ads/image1.jpg", "http://www.stackoverflow.com", "Your text goes here"],
来源:https://stackoverflow.com/questions/15285245/adding-links-to-javascript-image-arrays