基本信息
源码名称:jQuery点击图片放大
源码大小:0.37M
文件格式:.rar
开发语言:PHP
更新时间:2014-04-12
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Zoomable Image Gallery with CSS & jQuery – Sunflowa Media Web Site</title> </head> <link rel="stylesheet" type="text/css" href="css/index.css" /> <!-- The JavaScript --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> // <![CDATA[ /* * Copyright (C) 2010 Joel Sutherland * Licenced under the MIT license * Download by http://www.haolizi.net * http://www.newmediacampaigns.com/page/zoomable-jquery-image-gallery-jphotogrid */ (function($) { $.fn.jphotogrid = function(settings, callback) { settings = $.extend(true, { activeClass: 'active', selectedClass: 'selected', baseCSS: {}, selectedCSS: {} }, settings); var url = settings.flickrbase settings.feedapi '?'; var first = true; //Convert floats to absolute function toAbsolute(el){ $(el).children().each(function(){ var pos = $(this).position(); $(this).data('ptop',Math.floor(Number(pos.top)) 'px'); $(this).data('pleft',Math.floor(Number(pos.left)) 'px'); }).each(function(){ placeOriginal(this); }); } function placeOriginal(el, animate, callback){ var dtop = $(el).data('ptop'); var dleft = $(el).data('pleft'); var props = $.extend({ top: dtop, left: dleft }, settings.baseCSS); if(animate){ $(el).animate(props, 'slow', function(){ if($.isFunction(callback)) callback(); }); } else{ $(el).css($.extend(props, {position: 'absolute'})); } } function hideSelected(callback){ $container.find('.' settings.selectedClass).each(function(){ $(this).removeClass(settings.selectedClass); placeOriginal(this, true); }); if($.isFunction(callback)) callback(); } function select(el){ hideSelected(function(){ $(el).addClass('selected').removeClass('active'); $(el).animate(settings.selectedCSS, 'slow'); }); } for(var key in settings.qstrings){ if(!first) url = '&'; url = key '=' settings.qstrings[key]; first = false; } return $(this).each(function(){ $container = $(this); $(this).css('position','relative'); toAbsolute(this); $(this).children() .css('cursor', 'pointer') .hover(function(){ if(!$(this).hasClass(settings.selectedClass)) $(this).addClass(settings.activeClass); },function(){ $(this).removeClass(settings.activeClass); }); $('.' settings.activeClass).live('click', function(){ select(this); }); $('.' settings.selectedClass).live('click', function(){ hideSelected(); }); $(this).find('div') .hover(function(){ $(this).css('opacity', 0); },function(){ $(this).css('opacity', 0.5); }) .click(function(){ $(this).css('opacity', 1); $li = $(this).parent(); $li.css("z-index", 99); $li.animate({ top: 0, left: 0, width: '100%', height: '400px' }, 'slow'); }); }); } })(jQuery); $(document).ready(function(){ $('#pg').jphotogrid({ baseCSS: { width: '200px', height: '104px', padding: '0px' }, selectedCSS: { top: '50px', left: '100px', width: '360px', height: '187px', padding: '20px' } }); }); // ]]> </script> <body> <h2 class="title_name">Zoomable Image Gallery with <span>CSS & jQuery</span><small>by Sunflowa Media</small></h2> <div id="col"> <ul id="pg" class="thumb"> <li> <img src="images/main_image1.jpg" alt="images1" /> <p>Title Here</p> </li> <li> <img src="images/main_image2.jpg" alt="images2" /> <p>Title Here</p> </li> <li> <img src="images/main_image3.jpg" alt="images3" /> <p>Title Here</p> </li> <li> <img src="images/main_image4.jpg" alt="images4" /> <p>Title Here</p> </li> <li> <img src="images/main_image5.jpg" alt="images5" /> <p>Title Here</p> </li> <li> <img src="images/main_image6.jpg" alt="images6" /> <p>Title Here</p> </li> <li> <img src="images/main_image7.jpg" alt="images7" /> <p>Title Here</p> </li> <li> <img src="images/main_image8.jpg" alt="images8" /> <p>Title Here</p> </li> <li> <img src="images/main_image9.jpg" alt="images9" /> <p>Title Here</p> </li> </ul> <p class="copy_right">Check out <a href="http://www.sunflowamedia.com/blog/">Sunflowa Media Blog</a> for more tutorials!</p> </div> </body> </html>