html5中文学习网

您的位置: 首页 > 网站及特效实例 > javascript特效 » 正文

jQuery图片特效插件Revealing实现拉伸放大_jquery_

[ ] 已经帮助:人解决问题

点击图片,图片拉伸放大显示,效果非常棒!SE9HTML5中文学习网 - HTML5先行者学习网

使用方法:SE9HTML5中文学习网 - HTML5先行者学习网

1、head区域引用文件 jquery.js,photorevealer.js,datouwang.cssSE9HTML5中文学习网 - HTML5先行者学习网

2、在文件中加入<!-- 代码 开始 --><!-- 代码 结束 -->区域代码SE9HTML5中文学习网 - HTML5先行者学习网

3、图片个数可以自由增减,增加或者删除<td></td>即可SE9HTML5中文学习网 - HTML5先行者学习网

4、如果图片信息更多,需要更大的空间,可修改photorevealer.js中第36行的数字SE9HTML5中文学习网 - HTML5先行者学习网

核心代码:SE9HTML5中文学习网 - HTML5先行者学习网
SE9HTML5中文学习网 - HTML5先行者学习网

$(document).ready(function(){     $('.photo_slider').each(function(){     var $this = $(this).addClass('photo-area');  var $img = $this.find('img');  var $info = $this.find('.info_area');       var opts = {};     $img.load(function(){    opts.imgw = $img.width();    opts.imgh = $img.height();  });     opts.orgw = $this.width();  opts.orgh = $this.height();     $img.css ({    marginLeft: "-150px",    marginTop: "-150px"  });     var $wrap = $('<div class="photo_slider_img">').append($img).prependTo($this);   var $open = $('<a href="#" class="more_info">More Info ></a>').appendTo($this);     var $close = $('<a class="close">Close</a>').appendTo($info);     opts.wrapw = $wrap.width();  opts.wraph = $wrap.height();     $open.click(function(){    $this.animate({       width: opts.imgw,      height: (opts.imgh+30),      borderWidth: "10"    }, 600 );             $open.fadeOut();         $wrap.animate({       width: opts.imgw,      height: opts.imgh    }, 600 );     $(".info_area",$this).fadeIn();         $img.animate({      marginTop: "0px",      marginLeft: "0px"    }, 600 );         return false;  });     $close.click(function(){    $this.animate({       width: opts.orgw,      height: opts.orgh,      borderWidth: "1"     }, 600 );         $open.fadeIn();         $wrap.animate({       width: opts.wrapw,      height: opts.wraph       }, 600 );           $img.animate({        marginTop: "-150px",        marginLeft: "-150px"      }, 600 );     $(".info_area",$this).fadeOut();    return false;  });   }); });

以上所述就是本文的全部代码了,希望大家能够喜欢。SE9HTML5中文学习网 - HTML5先行者学习网

(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助