所以我相當新的JavaScript。我想添加一個鏈接到這個幻燈片中的每個圖像。只有兩個圖像。我試圖把它們鏈接起來,就像你在html中使用<a>
一樣......但是這不起作用,因爲它是Javascript。是否有一段簡單的代碼可以將Javascript幻燈片中的每個圖像鏈接到不同的網站?非常感謝。任何反饋都非常感謝。如何鏈接Javascript幻燈片中的單個圖像?
這是我的代碼。由於從dynamicdrive.com
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [1024, 511], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../Images/slideshow_wakeup.png"],
["../Images/slideshow_2.png"]
<!--["newappvantagemobile.com/images/slideshow_3.png"]-->
//<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:4500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 900, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})
我沒有看到您發佈的代碼有任何問題。也許我沒有明白你的觀點。 –
幻燈片放映效果非常好。但是,我如何添加超鏈接到圖像?例如[「..Images/slideshow_wakeup.png」],我可以在旁邊添加一些東西,以便鏈接。例如,他們會點擊圖片,並將它們帶到google.com –
fadeSlideShow()會做什麼?它是你自己的功能還是別人的代碼? – hayavuk