看图,求给图片放大功能!
http://www.winekee.com/eshop/ShowProduct.aspx?id=6194
新出现在问题,以下的程序是对的,但放大图片后,图片的边框没有了,怎办?
<!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=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function view(obj, src){
var div = obj.parentNode;
div.style.position = "relative";
var bigImg = document.createElement("img");
bigImg.src = src || obj.src;
bigImg.style.position = "absolute";
bigImg.style.left = "0px";
bigImg.style.top = "0px";
bigImg.style.zIndex = "100";
div.appendChild(bigImg);
bigImg.onmouseout = function(){
div.removeChild(this);
};
}
</script>
</head><body>
<div><img src="http://www.winekee.com/Images/upload/prod/2009512170049.jpg" border="1" width="160" height="160" onmouseover="view(this, '新图地址');" /></div>
</body>
</html>
http://www.winekee.com/eshop/ShowProduct.aspx?id=6194
新出现在问题,以下的程序是对的,但放大图片后,图片的边框没有了,怎办?
<!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=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function view(obj, src){
var div = obj.parentNode;
div.style.position = "relative";
var bigImg = document.createElement("img");
bigImg.src = src || obj.src;
bigImg.style.position = "absolute";
bigImg.style.left = "0px";
bigImg.style.top = "0px";
bigImg.style.zIndex = "100";
div.appendChild(bigImg);
bigImg.onmouseout = function(){
div.removeChild(this);
};
}
</script>
</head><body>
<div><img src="http://www.winekee.com/Images/upload/prod/2009512170049.jpg" border="1" width="160" height="160" onmouseover="view(this, '新图地址');" /></div>
</body>
</html>
如果是加Css边框,又怎样写!
<style type="text/css">
<!--
.sd {
border: 1px solid #CCCCCC;
}
-->
</style>