您的位置:首页 > Web前端 > JavaScript

JS图片放大查看效果!

2008-04-15 11:26 471 查看
http://bbs.blueidea.com/thread-2812683-1-1.html

http://bbs.blueidea.com/thread-2814846-1-1.html

应用效果

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title>Javascript Images zoom-out view sample. Brought to you by 斩梦人.天天

QQ:22062019</title>

</script>

</style>

</head>

<body>

Some text here<table cellpadding="0" cellspacing="0" border="2" width="100%">

<tr>

<td>1</td>

<td>2</td>

<td>3</td>

</tr>

<tr>

<td width="520" align="center">

<div id="picshow">

<img id="bpic" onload="loaddone(tempo)"/>

<div id="loading">

<img src="http://www.whoj.net/images/loading.gif" border="0"/> Loading

<div class="text">Please wait </div>

</div>

</td>

<td>

<div class="picbox" show="show"><!--设置show显示默认图片-->

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/b1.jpg" src="http://www.whoj.net/images/s1.jpg" onmousemove="move(event,this,0)" dLeft="700" dTop="300" title="设置标签属性show='show'显示默认图片,设置dLeft,dTop定义默认偏移量"/><!--src:小图,lowsrc:大图,showW/showH:可设置预览窗大小-->

</div>

<div class="picbox">

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/b2.jpg" src="http://www.whoj.net/images/s2.jpg" onmousemove="move(event,this,0)" showW="200" showH="200" title="可自定义预览图大小"/>

</div>

<div class="picbox">

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/b4.jpg" src="http://www.whoj.net/images/s4.jpg" width="302" onmousemove="move(event,this,0)" title="小图可以按比例放大"/><!--这里可以重新设置小图大小,尽量与大图比例保持一致-->

</div>

</td>

<td>In table

<div class="picbox">

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/b3.jpg" src="http://www.whoj.net/images/s3.jpg" width="60" onmousemove="move(event,this,0)" title="也可以按比例缩小"/>

</div>

<div class="picbox">

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/b3.jpg" src="http://www.whoj.net/images/s3.jpg" onmousemove="move(event,this,0)" showW="500" showH="200" title="可以嵌套在table中"/>

</div>

</td>

</tr>

</table>

Out of table

<div class="picbox">

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/b2.jpg" src="http://www.whoj.net/images/s2.jpg" onmousemove="move(event,this,0)" title="放在table外面也没有问题"/>

</div>

<div class="picbox">

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/s4.jpg" src="http://www.whoj.net/images/s4.jpg" onmousemove="move(event,this,0)" showW="1000" showH="1000" title="showW='1000' showH='1000',如果指定预览图比原图大,则使用原图大小" />

</div>

<div class="picbox">

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/b5.jpg" src="http://www.whoj.net/images/s5.jpg" onmousemove="move(event,this,0)" showW="160" showH="320" title="代码较上一版本健壮,能在IE,FF下稳定工作,基本支持OP,欢迎大家帮助测试!"/>

</div>

<div class="picbox">

<div class="view" onmousemove="if (!isIE) move(event,this,1)"></div>

<img class="spic" lowsrc="http://www.whoj.net/images/b5.jpg" src="http://www.whoj.net/images/s5.jpg" onmousemove="move(event,this,0)" width="500" height="112" title="即使没有按比例拉伸,也可以正常工作"/>

</div>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: