導航:首頁 > 動漫圖片 > 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點擊圖片放大效果怎麼做相關的資料

熱點內容
德國人穿衣服圖片大全 瀏覽:394
ppt中怎麼把一個圖片復制多份 瀏覽:929
簡單手帳小機關圖片 瀏覽:638
傷感男動漫高清圖片 瀏覽:417
淘寶圖片檢測文字 瀏覽:740
圖片如何與文檔模板融合 瀏覽:142
簡單可愛圖片動漫女生 瀏覽:363
燙發短發中卷發型圖片女生 瀏覽:831
晚安健身圖片高清 瀏覽:714
吶喊可愛圖片女生 瀏覽:121
word文檔版本不同顯示不一樣圖片 瀏覽:398
miumiu手包價格和圖片 瀏覽:669
lv新款女包圖片2015及價格查詢 瀏覽:374
貓的動漫萌圖高清圖片 瀏覽:787
關於簡單健康的手抄報圖片 瀏覽:88
天太熱了動漫圖片 瀏覽:635
男生傷心的哭圖片 瀏覽:538
word圖片設置格式嵌入型 瀏覽:433
文字圖片排版高級感 瀏覽:133
簡單水彩寫生圖片 瀏覽:983