<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
<style type="text/css">
#big{
width: 800px;
height: 500px;
background:gray;
}
.cla1{
width: 400px;
height: 400px;
background: red;
}
.cla2{
width: 800px;
height: 800px;
background: red;
}
a{
text-decoration: none;
font-size: 20px;
}
</style>
</head>
<body>
<div id="big">
<div id="small" class="cla1"><a href="javascript:void(0)" class="a1">放大</a>
<a href="javascript:void(0)" class="a2" style="display: none;">缩小</a>
</div>
<script type="text/javascript">
var big=document.getElementById('big');
var small=document.getElementById('small');
var a1=document.querySelector('.a1');
var a2=document.querySelector('.a2');
$(function(){
a1.onclick=function(){
$("#small").addClass("cla2");
$(".a1").hide();
$(".a2").show();
}
a2.onclick=function(){
$("#small").removeClass("cla2");
$(".a2").hide();
$(".a1").show();
}
})
</script>
</div>
</body>
</html>