$('image').click(function(){
if(clickNumber %2==0){
//放大代码
}else{
//缩小代码
}
clickNumber ++
})
这是一个拖动元素的效果<div id="div" style="width:100pxheight:100pxbackground-color:redposition: absolutecursor: move">
</div>
<script>
window.onload=function(){
var div=document.getElementById("div")
div.onmousedown=function(e){ //把onmousedown改成onclick就是你要的效果
var x= e.clientX-div.offsetLeft
var y= e.clientY-div.offsetTop
document.onmousemove=function(e){
div.style.left= e.clientX-x+"px"
div.style.top= e.clientY-y+"px"
}
document.onmouseup=function(){
document.onmousemove=null
}
}
}
</script>