導航:首頁 > 動漫圖片 > js點擊圖片放大效果怎麼做

js點擊圖片放大效果怎麼做

發布時間:2024-12-30 10:29:40

A. 點擊小圖看大圖的js,如何點擊大圖,能新窗口打開原始大圖

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JS特效學院|JsWeb8.cn|---簡單的圖片放大展示效果</title>
<style type="text/css">
.spic a img{-moz-opacity:0.5; filter:alpha(opacity=50);border:0px;}
.spic a:hover{font-size:9px;}
.spic a:hover img{-moz-opacity:0.5; filter:alpha(opacity=100);cursor:hand;}
</style>
<script type="text/javascript">
function seeBig(_this) {
OpenWindow = window.open("", "img", "");//打開新窗口
OpenWindow.document.write("<html>");//為新窗口設定html代碼
OpenWindow.document.write("<head>");
OpenWindow.document.write("<title>例子</title>");
OpenWindow.document.write("</head>");
OpenWindow.document.write("<body>");
OpenWindow.document.write("<img src='" + _this.parentNode.getElementsByTagName("img")[0].src + "' alt='' /");
OpenWindow.document.write("</body>");
OpenWindow.document.write("</html>");
OpenWindow.document.close();
//註:document.write 一行只能出現一種標簽
//需要 OpenWindow.document.close();
}
</script>
</head>
<body>
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td align="center"><span class="spic">
<a href="###" onclick="seeBig(this)" style="cursor:pointer">
<img border="0" src="http://www.jsweb8.cn/images/test001.jpg" width="50" height="50"></a></span></td>
<td align="center"><span class="spic">
<a href="###" onclick="seeBig(this)" style="cursor:pointer">
<img border="0" src="http://www.jsweb8.cn/images/test002.jpg" width="50" height="50"></a></span></td>
<td align="center"><span class="spic">
<a href="###" onclick="seeBig(this)" style="cursor:pointer">
<img border="0" src="http://www.jsweb8.cn/images/test003.jpg" width="50" height="50"></a></span></td>
<td align="center"><span class="spic">
<a href="###" onclick="seeBig(this)" style="cursor:pointer">
<img border="0" src="http://www.jsweb8.cn/images/test004.jpg" width="50" height="50"></a></span></td>
</tr>
<tr>
<td colspan="4" align="center" id="viewPic"><img id="view_img" border="0" src="http://www.jsweb8.cn/images/test001.jpg"></td>
</tr>
</table>
</body>
</html>

閱讀全文

與js點擊圖片放大效果怎麼做相關的資料

熱點內容
word中圖片環繞形式幾種 瀏覽:514
word文檔里如何並排插入兩張圖片 瀏覽:164
手工碎紙做衣服圖片 瀏覽:90
粉藍漸變女生可愛生日蛋糕圖片 瀏覽:87
天秤座少女動漫圖片 瀏覽:358
高清美女組合圖片 瀏覽:288
生日蛋糕圖片男生五歲 瀏覽:683
怎麼把圖片加入閃光 瀏覽:146
塗鴉娃娃圖片大全 瀏覽:920
美女秀禾圖片 瀏覽:365
場景圖片簡單 瀏覽:843
橙棕色發色男士發型圖片 瀏覽:695
琉璃玉價格及圖片 瀏覽:559
如何讓word中圖片變亮 瀏覽:243
耀圖片動漫 瀏覽:184
尚家木門價格及圖片 瀏覽:433
高清漫畫圖片易畫 瀏覽:274
電視劇芭比高清圖片 瀏覽:422
男生專用背景圖片頭像 瀏覽:615
二十元人民幣背景圖片如何獲取 瀏覽:282