jQuery圖片特效插件Revealing實(shí)現(xiàn)拉伸放大
點(diǎn)擊圖片,圖片拉伸放大顯示,效果非常棒!
使用方法:
1、head區(qū)域引用文件 jquery.js,photorevealer.js,datouwang.css
2、在文件中加入<!-- 代碼 開始 --><!-- 代碼 結(jié)束 -->區(qū)域代碼
3、圖片個(gè)數(shù)可以自由增減,增加或者刪除<td></td>即可
4、如果圖片信息更多,需要更大的空間,可修改photorevealer.js中第36行的數(shù)字
核心代碼:
$(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; }); }); });
以上所述就是本文的全部代碼了,希望大家能夠喜歡。
相關(guān)文章
jquery計(jì)算出left和top,讓一個(gè)div水平垂直居中的簡單實(shí)例
下面小編就為大家?guī)硪黄猨query計(jì)算出left和top,讓一個(gè)div水平垂直居中的簡單實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2016-07-07JQEasy-ui在IE9以下版本中二次加載的問題分析及處理方法
之前項(xiàng)目中才用了Easy-ui,但是在同時(shí)使用tree和grid的效果時(shí),因?yàn)轫撁嬗袀z個(gè)URL,分別為Ajax樹去后臺(tái)取數(shù)據(jù)和Grid取數(shù)據(jù),在IE9以上以及其他瀏覽器里都沒有問題,在Ie低版本時(shí)會(huì)出現(xiàn)先加載表格,然后一閃而過加載樹渲染頁面,造成頁面只有tree數(shù)據(jù)而沒有表格grid數(shù)據(jù)。2014-06-06一句jQuery代碼實(shí)現(xiàn)返回頂部效果(簡單實(shí)用)
本文主要分享了利用一句jQuery代碼實(shí)現(xiàn)返回頂部效果的實(shí)例。代碼簡單,保存到HTML文件就可以體驗(yàn)效果。下面跟著小編一起來看下吧2016-12-12jQuery獲取table行數(shù)并輸出單元格內(nèi)容的實(shí)現(xiàn)方法
這篇文章主要介紹了jQuery獲取table行數(shù)并輸出單元格內(nèi)容的實(shí)現(xiàn)方法,涉及jQuery針對表格與頁面元素的動(dòng)態(tài)操作技巧,需要的朋友可以參考下2016-06-06