Question: When clicking on an image link, you can see both the picture and the original picture list on the current page
Workaround: Add a placeholder to reserve a browse area for the picture
1, add a placeholder after the list
2, change the SRC attribute of the placeholder
function Showpic (whichpic) {var Placeholder=document.getelementbyid ("placeholder");//Get the contents of the IMG element through the id attribute
var source=whichpic.getattrribute ("src");//Gets the value of the SRC attribute of the clicked Picture link
Placeholder.setattribute ("src", source);//Modify the SRC attribute of the IMG element for the currently clicked picture Link
}
3, in the picture list in the Call function
<li><a href= "img/001.jpg" onclick= "showpic (this); return false;" title= "" >Rose</a></li>
Description: This indicates that the <a> element node, return False indicates that the JS code returned to the OnClick event handler value is False, will think "this link is not clicked", so click on the link will not be taken to another image viewer.
Calls to JavaScript functions (via nodes)--javascript DOM programming art