jQuery圖片特效外掛程式Revealing實現展開放大,

來源:互聯網
上載者:User

jQuery圖片特效外掛程式Revealing實現展開放大,

點擊圖片,圖片展開放大顯示,效果非常棒!

使用方法:

1、head地區引用檔案 jquery.js,photorevealer.js,datouwang.css

2、在檔案中加入<!-- 代碼 開始 --><!-- 代碼 結束 -->地區代碼

3、圖片個數可以自由增減,增加或者刪除<td></td>即可

4、如果圖片資訊更多,需要更大的空間,可修改photorevealer.js中第36行的數字

核心代碼:

$(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;  });   }); });

以上所述就是本文的全部代碼了,希望大家能夠喜歡。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.