js了解的不多,上网总是看见网站上的一些图片浏览效果非常好,点击图片具有切换放大缩小的功能,今天简单做了个小测试,但要实现网页上浏览的效果还需要进一步编写
今天不多说,直接贴上代码:
<!DOCTYPE html>
<html>
<head>
<style>
.one
{
width:200px;
heoght:300px;
}
.two
{
width:400px;
height:400px;
}
</style>
<script>
function newwindow()
{
var image=document.getElementById("one");
if(image.className=="one"){
image.className="two";
}
else{
image.className="one";
}
}
</script>
</head>
<body>
<center>
<img src="images/psb.jpg" id="one" onClick="newwindow()"&