所以我对javascript很新。我想在此幻灯片中添加指向每个图像的链接。只有两个图像。我试图像你在html中使用<a>
那样链接它们......但是这不起作用,因为它是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: ""
})
答案 0 :(得分:1)
来自imagearray
数组的original documentation:
["path_to_image", "optional_url", "optional_linktarget", "optional_description"]
因此您需要将imagearray
数组更改为:
imagearray: [
["../Images/slideshow_wakeup.png"], "../Images/slideshow_wakeup.png", "_new", "Some text to describe the image."],
["../Images/slideshow_2.png", "../Images/slideshow_2.png", "_new", "Some text to describe the image."],
<!--["newappvantagemobile.com/images/slideshow_3.png"]-->
//<--no trailing comma after very last image element!
],
我会解释一下。该数组有4个元素。
_new
表示新窗口/标签希望这有帮助。