1最好用的点击
$(document).on("click","#enlargeImgId",function(event){
var width = $(this).width();
if(width==100)
{
$(this).width(300);
$(this).height(300);
}
else
{
$(this).width(100);
$(this).height(100);
}
});
后边实际需要而定
2、点击
$("#enlargeImgId").click(function(){
var width = $(this).width();
if(width==100)
{
$(this).width(300);
$(this).height(300);
}
else
{
$(this).width(100);
$(this).height(100);
}
});
3绑定
$("#enlargeImgId").bind("click",function(){
var width = $(this).width();
if(width==100)
{
$(this).width(300);
$(this).height(300);
}
else
{
$(this).width(100);
$(this).height(100);
}
});