鼠标移到文字上出现图片提示的代码?

发布网友 发布时间:2022-04-23 12:46

我来回答

5个回答

热心网友 时间:2022-04-23 22:45

范例代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>鼠标移到文字上弹出提示层</title>
<style type="text/css">
.item .box{
display:none; 
width: 315px;
height: 180px; 
background:#CCC;
border:1px solid #333;
padding:12px;
text-align:center;
}
.item:hover .box{
display:block;
}
</style>
</head>
<body>
<div class="item">
<a href="#">查看光度范围</a>
<div class="box" id="box"><img src="11.jpg" /></div>
</div>
<div class="item">
<a href="#">查看光度范围</a>
<div class="box" id="box"><img src="10.jpg" /></div>
</div>
</body>
</html>

热心网友 时间:2022-04-24 00:03

以上回答问题者都是答非的问。
楼主应该讲的是网页制作里的鼠标特效吧,虽然我也不是很懂,但在网上搜到一段代码,不知道管不管用,楼主可以一试。
html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页特效|JsCode.cn|---跟随鼠标的图片</title>
<script LANGUAGE="JavaScript">
var newtop=0
var newleft=0
if (navigator.appName == "Netscape") {
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}
else
{
layerStyleRef="layer.style.";
layerRef="document.all";
styleSwitch=".style";
}
function doMouseMove() {
layerName = 'iit'
eval('var curElement='+layerRef+'["'+layerName+'"]')
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')
eval('curElement'+styleSwitch+'.visibility="visible"')
eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
eval('height=curElement'+styleSwitch+'.height')
eval('width=curElement'+styleSwitch+'.width')
width=parseInt(width)
height=parseInt(height)
if (event.clientX > (document.body.clientWidth - 5 - width))
{
newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width
}
else
{
newleft=document.body.scrollLeft + event.clientX
}
eval('curElement'+styleSwitch+'.pixelLeft=newleft')
if (event.clientY > (document.body.clientHeight - 5 - height))
{
newtop=document.body.clientHeight + document.body.scrollTop - 5 - height
}
else
{
newtop=document.body.scrollTop + event.clientY
}
eval('curElement'+styleSwitch+'.pixelTop=newtop')
}
document.onmousemove = doMouseMove;
</script>
</head>

<body>
<!-- 以下代码是设定此页的鼠标样式代码 -->
<script language="javascript">
if (navigator.appName == "Netscape") {
}
else
{
document.write('<div ID=OuterDiv>')
document.write('<img ID=iit src="images/flag.gif" STYLE="position:absolute;TOP:5pt;LEFT:5pt;Z-INDEX:10;visibility:hidden;">')
document.write('</div>')
}
</script>
</body>

</html>

热心网友 时间:2022-04-24 01:37

网站上还是文档里 还什么什么地方

热心网友 时间:2022-04-24 03:29

具体是什么样子,截个图来看看

我觉得只要不影响你的正常使用,就不用管它了

热心网友 时间:2022-04-24 05:37

是啊截个图看看,要不请具体描术一下这样才知道怎么解决问题!

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com