jquery实现图片放大效果
好久没更新了,先来一发关于jquery图片放大缩小的代码
直接上代码
前端页面:
<tr><tdheight="30"align="right"bgcolor="#f2f2f2"class="left_txt2">产品相册</td><tdbgcolor="#f2f2f2"> </td><tdwidth="32%"height="30"bgcolor="#f2f2f2"class="goodsimgupload"><spanid="uploadPercent"></span><inputtype="hidden"value="<?phpecho$result['goodsimg'];?>"name="goodsimg"/><imgsrc="<?phpecho$result['goodsimg'];?>"id="img_id"class="img"width="100"height="50"></td></tr>
$(function(){varisbig=-1;//定义全局变量判断放大缩小自己发挥的写吧$(".img").click(function(){if(isbig==-1){$("#img_id").animate({height:"300px",width:"300px"});isbig=1;}else{$("#img_id").animate({height:"50px",width:"100px"});isbig=-1;}});});
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。