Home  >  Article  >  Web Front-end  >  jquery实现带缩略图的全屏图片画廊效果实例_jquery

jquery实现带缩略图的全屏图片画廊效果实例_jquery

WBOY
WBOYOriginal
2016-05-16 15:52:471125browse

本文实例讲述了jquery实现带缩略图的全屏图片画廊效果。分享给大家供大家参考。具体如下:

运行效果如下图所示:

主要代码如下:

(function($) {
$.fn.preload = function(options) {
  var opts = $.extend({}, $.fn.preload.defaults, options);
  o   = $.meta ? $.extend({}, opts, this.data()) : opts;
  var c  = this.length,
   l  = 0;
  return this.each(function() {
   var $i = $(this);
   $('<img / alt="jquery实现带缩略图的全屏图片画廊效果实例_jquery" >').load(function(i){
    ++l;
    if(l == c) o.onComplete();
   }).attr('src',$i.attr('src')); 
  });
 };
 $.fn.preload.defaults = {
  onComplete : function(){return false;}
 };
})(jQuery);

完整实例代码点击此处本站下载

希望本文所述对大家的jquery程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn