Jquery,用户交互:悬停链接以突出显示项目组合
这更多是我为自己设定的学习数组的任务,但现在我想知道是否你们中的任何人都可以想出一种更好、更清洁的方法来完成这项任务。我只是想要一个项目列表,当用户将鼠标悬停在某些链接上时突出显示。
我想要做什么
我有一个项目列表,在每个项目中我可以从事 SEO、开发或设计。页面上还有一个链接列表:设计、开发和 SEO。当将鼠标悬停在链接上时,我希望突出显示一些项目..(组合)。因此,我可能会完成多个任务的某些项目将突出显示多个链接......
我目前如何尝试执行此操作
我认为我可以使用列表创建一个二维数组项目的断断续续。根据您将鼠标悬停在哪个链接上,会拉出正确的数组,如果您看到 JSfiddle 链接,那就是我能做的。
非常相似的示例
感谢您提供任何帮助或建议
我希望我能清楚地解释这一点,我知道我可以撕掉示例链接的代码,但我宁愿从中学习剪切和粘贴.. - 看看别人的想法和使用jquery。
This is more of a task I have set myself to learn Arrays but now I was wondering if any of you can think of a better cleaner way of doing this task. I simply want a list of projects which highlight when the user hovers over some links..
What I want to do
I have a list of projects, on each project I could have worked on the SEO, Develpment or Design. On the page there is also a list of links say: Design, Development and SEO. When hovering over a link I want some of the projects to highlight..(combinations). So some projects I might of done more then one task on will highlight for more then one link.....
How I currently tried to do this
I thought that I could make a 2d array with a list of on offs for the projects. Depending on what link you hovered over pulls out the correct array, if you see the JSfiddle link, that is as far as I could go.
An Example of something very similar
Thank You for anyhelp or advice
I hope I explained that clearly, I know I could rip the code off for the example link, but I rather learn from doing then just cut and paste.. - see what others think and use jquery.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为每个项目使用 3 种不同的样式,例如:“.design”、“.seo”、“.development”
说明:
当鼠标悬停在 link1 上时,使用 .design 类的元素上的 .highlight 类会切换(鼠标悬停时添加,鼠标移出时删除)。您可以对其他 2 门课程进行类似的操作。
You can use 3 different styles for each project , let say : ".design", ".seo", ".development"
Explanation:
When mouse is hovered over link1 a class .highlight is toggled (added when mouseover,removed when mouseout) on elements that use .design class. You can do similar way to others 2 classes.