简体   繁体   English

当页面上的链接悬停时,将一个 div 背景更改为多个图像

[英]Changing ONE div background to several images when links on page are hovered

I have a page I am working on that has several links, but has a persistent area where a background fades into a new image when any of those links are hovered over.我有一个我正在处理的页面,它有几个链接,但有一个持久区域,当这些链接中的任何一个悬停在上面时,背景会淡入新图像。 sort of like this script: http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm有点像这个脚本: http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

except the only option with that script is to have those links target that large image, I need those links to go to separate places entirely.除了该脚本的唯一选择是让那些链接指向那个大图像,我需要那些指向 go 的链接来完全分隔位置。

What can I do about this?我该怎么办? Thanks for the help.谢谢您的帮助。

You would just place this code within each of the small images and change the 'where_you_want_it_to_go' part, depending on the destination.您只需将此代码放在每个小图像中,并根据目的地更改“where_you_want_it_to_go”部分。

onmouseover=document.getElementById('where_you_want_it_to_go').innerHTML= '<img src="image.jpg/>';"

Is this what you were looking for?这是你要找的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM