創建縮略圖的jQuery插件:jQThumb
jQThumb 是一款基于 jQuery 的縮略圖插件,它能夠很方便的制作指定的尺寸的縮略圖。 它支持 IE6 從 jQuery >=v1.3 或 Zepto (with zepto-data plugin) >=v1.1.3。
經測試支持的瀏覽器:
- Google Chrome
- Mozilla Firefox
- Safari
- 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!');
}
});
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!