<%@page contentType="text/html" pageEncoding="UTF-8"%><!DOCTYPE html><html>? ? <head>? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">? ? ? ? <title>Picture Album</title>? ? ? ? <style>? ? ? ? ? ? #wrap{? ? ? ? ? ? ? ? width: 50%;? ? ? ? ? ? ? ? margin: 0 auto;? ? ? ? ? ? }? ? ? ? ? ? #presentation{? ? ? ? ? ? ? ? float:left;? ? ? ? ? ? ? ? font-size: 20px;? ? ? ? ? ? }? ? ? ? ? ? #showing{? ? ? ? ? ? ? ? float:right; ? ? ? ? ??? ? ? ? ? ? }? ? ? ? </style>? ? ? ? <script type="text/javascript">? ? ? ? ? ? function change(obj) {? ? ? ? ? ? ? ? var source = obj.getAttribute("href");? ? ? ? ? ? ? ? var placeholder = document.getElementById("showing");? ? ? ? ? ? ? ? placeholder.setAttribute("src", source);? ? ? ? ? ? }? ? ? ? </script>? ? </head>? ? <body>? ? ? ? <h1 style="text-align:center;">Picture Album</h1>? ? ? ? <div id="wrap">? ? ? ? ? ? <div id="presentation">? ? ? ? ? ? ? ? <ul>? ? ? ? ? ? ? ? ? ? <li><a href="photo/blue.jpg" onclick="change(this);return false;">Blue</a></li>? ? ? ? ? ? ? ? ? ? <li> <a href="photo/fire.jpg" onclick="change(this);return false;">Fire</a></li>? ? ? ? ? ? ? ? ? ? <li><a href="photo/sex.jpg" onclick="change(this);return false;">Sex</a></li>? ? ? ? ? ? ? ? </ul>? ? ? ? ? ? </div>? ? ? ? ? ? <div ?id="showing">? ? ? ? ? ? ? ? <img width="300" height="200" src="photo/world.jpg"/>? ? ? ? ? ? </div>? ? ? ? </div>? ? </body></html>想問一下 ?為什么點擊鏈接后,該頁面放置圖片的地方的圖片沒有改變???
關(guān)于JS的問題
Will_木
2017-06-01 15:59:02