我还没有使用这个jQuery工具。但我认为,该工具将需要结构
<div id="products">
<img src="http://static.flowplayer.org/img/commerce/free.png" alt="Free version" />
<img src="http://static.flowplayer.org/img/commerce/commercial.png" alt="Commercial version" />
<img src="http://static.flowplayer.org/img/commerce/multidomain.png" alt="Multidomain version" />
</div>
该工具会寻找一个div内的IMG(同样,我还没有看到代码,所以这是一个假设)。许多jQuery插件需要特定的格式。
我这样做:
<div id="products">
<img src="http://static.flowplayer.org/img/commerce/free.png" alt="Free version" id="image1" />
<img src="http://static.flowplayer.org/img/commerce/commercial.png" alt="Commercial version" id="image2" />
<img src="http://static.flowplayer.org/img/commerce/multidomain.png" alt="Multidomain version" id="image3" />
</div>
添加的ID给每个标签。我试过了,它似乎没有打破插件。 (对不起可怕的命名约定:))
然后使用JavaScript的图像的点击绑定到重定向:
$("#image1").click(function() {
window.location = 'http://www.google.co.za';
});
$("#image2").click(function() {
window.location = 'http://www.google.co.za/somwhereelse';
});
$("#image3").click(function() {
window.location = 'http://www.google.co.za/helloworld';
});
希望帮助
编辑
要回答你的问题显示页面加载中的第二个图像的内容,我有以下解决方案。这感觉有点像我的解决方法,但希望它有效。
在您的页面上,发生什么事是流水游戏会隐藏除使用内联样式的第一个图像之外的所有图像。
所以我们需要做的是从第一个图像中删除这种风格,并将其添加到第二个图像。请记住,这只能在页面加载时发生,因此您需要将其添加到document.ready函数中。
//make the display attribute of the style none. This will render it invisible
$("#free").css('display','none');
//make the display attribute of the style block (as what Flowplayer does)
$("#commercial").css('display','block');
重要的是,这只发生一次,然后FlowPlayer功能通常在鼠标悬停时启用。
感谢您的帮助 - 它适合我!你是否有一个想法,以及如何强制打开演示页面而不是第一张图片的上下文时显示第二张图片的“上下文”? – 2010-02-01 14:58:53
请参阅编辑。我希望这给你你正在寻找的 – Kamal 2010-02-01 16:00:33
再次感谢 - 你的第二个建议也在工作。没有恐惧,这是我的最后一个问题;-) – 2010-02-01 16:59:59