求代码:小图在鼠标经过时显示大图!越简练越好!救命!! 哪位大哥有小图在鼠标经过时显示大图的代码!越简练越好!救命!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <img src="google." style="width:100px;height:100px;" onmouseover="this.style.cssText='width:200px;height:200px'" onmouseout="this.style.cssText='width:100px;height:100px'"/> 写了一小段,IE6sp1,FF2.0测试可用!L@_@K<!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> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="Gao YiXiang" /> <meta name="email" content="[email protected]" /> <meta name="keywords" content="javascript dhtml dom" /> <meta name="description" content="I love web development." /> <style type="text/css">body{ padding: 50px 50px 50px 50px;}.divImg{ float: left;}.imgOriginal{ position: absolute; float: left; display: none; background-color: #ffffff; border: 1px dotted #ff0000;} </style></head><body> <div class="divImg"> <img class="imgOriginal" /> <img src="http://www.google.cn/logos/Logo_25wht.gif" id="imgThumb" onmouseover="showOriginal(this, 'http://www.google.cn/logos/Logo_40wht.gif')" /> </div> <div class="divImg"> <img class="imgOriginal" /> <img src="http://logo.baidu.com/img/2006/zengji/show_02.gif" id="imgThumb" onmouseover="showOriginal(this, 'http://www.baidu.com/img/slogo_06chunjie.gif')" /> </div> <script type="text/javascript"> <!--function showOriginal(oElement, sOriginalUrl){ if (oElement.largeImg == undefined) { oElement.largeImg = oElement.parentNode.getElementsByTagName("img")[0]; oElement.largeImg.src = sOriginalUrl; var thumbWidth = oElement.width; var thumbHeight = oElement.height; oElement.largeImg.onload = function() { this.style.marginLeft = -(this.width-thumbWidth)/2 + "px"; this.style.marginTop = -(this.height-thumbHeight)/2 + "px"; }; oElement.largeImg.onmouseout = function() { this.style.display = "none"; }; } oElement.largeImg.style.display = "block";}; //--> </script></body></html> <!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><script language="javascript">function showPhoto(x){var thissrc;var strinner;if(x==0){document.getElementById("thisPhoto").innerHTML='';}else{thissrc=document.getElementById("p"+x).src;strinner="<img width='600' src='" + thissrc + "' /><div><a href='" + thissrc + "' target='_blank'> ZOOM </a> " + "</div>";document.getElementById("thisPhoto").innerHTML = strinner;}}</script></head><body><div id="thisPhoto"></div><div class="photoalbum"> <p><img id="p1" onclick="showPhoto(1)" class="photoText" src="http://zi.csdn.net/12060_2.jpg" width="150" /> </p> <p>http://zi.csdn.net/12060_2.jpg</p></div><div class="photoalbum"> <p><img id="p2" onclick="showPhoto(2)" class="photoText" src="http://zi.csdn.net/100090_.gif" width="150" /> </p> <p>http://zi.csdn.net/100090_.gif</p></div><input type="button" onclick="showPhoto(0)" value="close" /></body></html> iframe submit提交,返回页面显示到主窗口上了 JS中如何实现循环的行互换? div中checkbox事件 已知id如何获得classname? 怎么做出这种窗体类似自由落体反弹的效果? 脚本控制图片轮转的效果问题! 怎么判断select控件里面没有数据或者text控件不存在? 去掉热点的焦点问题 请问这是ie版本的问题么? ckeditor 4.4.7 粘贴时保留word格式的问题 很简单?提示我image1Id未定义? 哪个高手有好的简单的验证码的原代码发来!急!急!急!
onmouseover="this.style.cssText='width:200px;height:200px'"
onmouseout="this.style.cssText='width:100px;height:100px'"/>
L@_@K
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
<style type="text/css">
body
{
padding: 50px 50px 50px 50px;
}
.divImg
{
float: left;
}
.imgOriginal
{
position: absolute;
float: left;
display: none;
background-color: #ffffff;
border: 1px dotted #ff0000;
}
</style>
</head>
<body>
<div class="divImg">
<img class="imgOriginal" />
<img src="http://www.google.cn/logos/Logo_25wht.gif" id="imgThumb" onmouseover="showOriginal(this, 'http://www.google.cn/logos/Logo_40wht.gif')" />
</div>
<div class="divImg">
<img class="imgOriginal" />
<img src="http://logo.baidu.com/img/2006/zengji/show_02.gif" id="imgThumb" onmouseover="showOriginal(this, 'http://www.baidu.com/img/slogo_06chunjie.gif')" />
</div>
<script type="text/javascript">
<!--
function showOriginal(oElement, sOriginalUrl)
{
if (oElement.largeImg == undefined)
{
oElement.largeImg = oElement.parentNode.getElementsByTagName("img")[0];
oElement.largeImg.src = sOriginalUrl; var thumbWidth = oElement.width;
var thumbHeight = oElement.height;
oElement.largeImg.onload = function()
{
this.style.marginLeft = -(this.width-thumbWidth)/2 + "px";
this.style.marginTop = -(this.height-thumbHeight)/2 + "px";
};
oElement.largeImg.onmouseout = function()
{
this.style.display = "none";
};
}
oElement.largeImg.style.display = "block";
}; //-->
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function showPhoto(x){
var thissrc;
var strinner;
if(x==0){
document.getElementById("thisPhoto").innerHTML='';
}else{
thissrc=document.getElementById("p"+x).src;
strinner="<img width='600' src='" + thissrc + "' /><div><a href='" + thissrc + "' target='_blank'> ZOOM </a> " + "</div>";
document.getElementById("thisPhoto").innerHTML = strinner;
}
}
</script>
</head><body>
<div id="thisPhoto"></div>
<div class="photoalbum">
<p><img id="p1" onclick="showPhoto(1)" class="photoText" src="http://zi.csdn.net/12060_2.jpg" width="150" /> </p>
<p>http://zi.csdn.net/12060_2.jpg</p>
</div>
<div class="photoalbum">
<p><img id="p2" onclick="showPhoto(2)" class="photoText" src="http://zi.csdn.net/100090_.gif" width="150" /> </p>
<p>http://zi.csdn.net/100090_.gif</p>
</div>
<input type="button" onclick="showPhoto(0)" value="close" />
</body>
</html>