jquery 工具 - 选项卡鼠标悬停 - 添加链接 [英] jquery tools - tabs mouseover - adding a link
问题描述
我喜欢这个工具在将鼠标移动到像素上时显示文本:
I love this tool to show text when moving the mouse over the pix:
http://flowplayer.org/tools/demos/tabs/mouseover.htm
现在我正在尝试打开一个链接,当鼠标单击其中一个像素时.我试过这样:
Now I'm trying to open a link, when one of the pix is clicked by the mouse. I tried this way:
original: <'img src="http://static.flowplayer.org/img/commerce/commercial.png" alt="Commercial version" />'
adding link: <'a title="Mylink" href="http://mylink.com" target="_blank"><'img src="http://static.flowplayer.org/img/commerce/free.png" alt="Free version" /></a>''
[插入 ' 仅显示源代码.]
[The ' are inserted to show the source only.]
有了这个链接,鼠标悬停不再起作用.有人知道在那里做什么吗?
With this link mouseover is no longer working. Does somebody know what to do there?
提前感谢您的帮助!
推荐答案
最简单的解决方案:确保所有图像都包含在 <a>
中.即:
SIMPLEST solution: make sure all the images are wrapped in <a>
. i.e.:
<div id="products">
<a href="#"><img src="http://static.flowplayer.org/img/commerce/free.png" alt="Free version" /></a>
<a href="#"><img src="http://static.flowplayer.org/img/commerce/commercial.png" alt="Commercial version" /></a>
<a href="#"><img src="http://static.flowplayer.org/img/commerce/multidomain.png" alt="Multidomain version" /></a>
</div>
这很好用;我刚试过.我假设 jQuery 工具选项卡仅在您指定的容器的所有子项都是相同类型时才有效.
This works fine; I just tried it. I'm assuming that jQuery Tools Tabs only works if all the children of the container you specify are the same type.
是的,它似乎只适用于它遇到的第一种类型的标签.例如如果您将前两个链接放入 <a>
而不是第三个,则鼠标悬停仅适用于前两个.
yes, it seems to work only with the first type of tag it encounters. e.g. if you put the first two links in <a>
and not the third, mouseover only works for the first two.
这篇关于jquery 工具 - 选项卡鼠标悬停 - 添加链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!