创建缩略图的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 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!