创建缩略图的jQuery插件:jQThumb

jopen 10年前

jQThumb 是一款基于 jQuery 的缩略图插件,它能够很方便的制作指定的尺寸的缩略图。 它支持 IE6 从 jQuery >=v1.3 或  Zepto (with zepto-data plugin) >=v1.1.3。

经测试支持的浏览器:

  1. Google Chrome
  2. Mozilla Firefox
  3. Safari
  4. Internet Explorer 6, 7, 8, 9 and 10

$('img').jqthumb({      classname      : 'jqthumb',        // class name. DEFUALT IS jqthumb      width          : 100,              // new image width after cropping. DEFAULT IS 100px.      height         : 100,              // new image height after cropping. DEFAULT IS 100px.      position: {          top  : '50%',                  // position of the image. DEFAULT is 50%. 50% also means centerize the image.          left : '50%'                   // position of the image. DEFAULT is 50%. 50% also means centerize the image.      },      source         : 'src',            // to specify the image source attribute. DEFAULT IS src.      showoncomplete : false,            // TRUE = show immediately after processing. FALSE = do not show it. DEFAULT IS TRUE.      before         : function(){       // callback before processing.          alert("I'm about to start processing now...");      },      after          : function(imgObj){ // callback when ONE image is cropped.          $(imgObj).fadeIn();      },      done           : function(){       // callback when ALL images are cropped.          alert('Done!');      }  });

项目主页:http://www.open-open.com/lib/view/home/1409324326869