我遇到了java carousel的问题。代码在我的页面上工作正常,但我想添加图像的超链接,但我不确定如何实现这一点。我已经尝试了一些东西,但它只是导致代码停止工作,而旋转木马则从页面上掉下来。
正如我所说的,它一切正常,但是一旦我改变默认代码,它就会动摇。
我到目前为止的代码是:
<script type="text/javascript">
var firstbgcarousel=new bgCarousel({
wrapperid: 'mybgcarousel', //ID of blank DIV on page to house carousel
imagearray: [
['autumnpark.jpg', '<h2>Autumn Day</h2>The sun peaks through the trees, a knife that cuts through the chill, crisp air.'], //["image_path", "optional description"]
['chime.jpg', '<h2>Wind Chime</h2>The bellweather of the sky, the chime speaks of impending turmoil.'],
['girlportrait.jpg', 'The scent of spring invigorates her as she inhales whilst the warm breeze brings a wave of tranquility.'],
['redbench.jpg', 'Alone and Lonliness- Peace and Inner Struggle'] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:3000, cycles:2, stoponclick:false, pauseonmouseover:true},
navbuttons: ['left.gif', 'right.gif', 'up.gif', 'down.gif'], // path to nav images
activeslideclass: 'selectedslide', // CSS class that gets added to currently shown DIV slide
orientation: 'h', //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 500 //transition duration (milliseconds)
})
</script>
感谢任何帮助......
答案 0 :(得分:0)
在这里查看来源: http://home.comcast.net/~jscheuer1/side/bgcarousel/demo_linked.htm
很好的例子。只需在幻灯片文本中添加一个链接,然后使用CSS将其设置为幻灯片框的宽度和高度的100%。