adding links to JavaScript image arrays

 ̄綄美尐妖づ 提交于 2019-12-11 08:09:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!