ASP.NET怎么控制图片得大小,并且在切换是上面显示得是大图,而下面就显示小图,要该怎么 写求例子 在线等
3个回答
展开全部
直接在小图上设置宽度和高度,这样图片会自动缩小。不过这样的话,下图的下载量还是和大图是一样的。那样你只能用工具把图片缩小,然后保存图2 然后小图读取图2
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个是当鼠标滑过图片时,就放大当前的图片,不知道对你是否有帮助,看以看看!
<head runat="server">
<title>无标题页</title>
<script type ="text/javascript" >
function changeImage(i)
{
var mImg = document .getElementById ('mainImage');
mImg.src = document .getElementById (i).src;
}
</script>
<style type ="text/css" >
img
{
vertical-align :top ;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style =" width :600px; height :300px;">
<div style =" width :500px; height :300px; float :left ">
<img src ="image/p1.jpg" style ="width :500px; height :300px;" id = "mainImage" />
</div>
<div style ="width :100px; height :300px; float :left ">
<img src ="image/p1.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img1')" id = "img1" />
<img src ="image/p2.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img2')" id = "img2" />
<img src ="image/p3.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img3')" id = "img3" />
<img src ="image/p4.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img4')" id = "img4" />
<img src ="image/p5.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img5')" id = "img5" />
<img src ="image/p6.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img6')" id = "img6" />
</div>
</div>
</form>
</body>
<head runat="server">
<title>无标题页</title>
<script type ="text/javascript" >
function changeImage(i)
{
var mImg = document .getElementById ('mainImage');
mImg.src = document .getElementById (i).src;
}
</script>
<style type ="text/css" >
img
{
vertical-align :top ;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style =" width :600px; height :300px;">
<div style =" width :500px; height :300px; float :left ">
<img src ="image/p1.jpg" style ="width :500px; height :300px;" id = "mainImage" />
</div>
<div style ="width :100px; height :300px; float :left ">
<img src ="image/p1.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img1')" id = "img1" />
<img src ="image/p2.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img2')" id = "img2" />
<img src ="image/p3.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img3')" id = "img3" />
<img src ="image/p4.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img4')" id = "img4" />
<img src ="image/p5.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img5')" id = "img5" />
<img src ="image/p6.jpg" style ="width :100px; height:50px" onmouseover ="changeImage('img6')" id = "img6" />
</div>
</div>
</form>
</body>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询