이미지 리사이즈 스크립트 파일명 변경
This commit is contained in:
@ -1,44 +0,0 @@
|
||||
(function($) {
|
||||
$.fn.iteminfoimageresize = function(selector)
|
||||
{
|
||||
var cfg = {
|
||||
selector: "img"
|
||||
};
|
||||
|
||||
if(typeof selector == "object") {
|
||||
cfg = $.extend(cfg, selector);
|
||||
} else {
|
||||
if(selector) {
|
||||
cfg = $.extend({ selector: selector });
|
||||
}
|
||||
}
|
||||
|
||||
var $img = this.find(cfg.selector);
|
||||
var $this = this;
|
||||
|
||||
function image_resize()
|
||||
{
|
||||
var width = $this.width();
|
||||
|
||||
$img.each(function() {
|
||||
$(this).removeAttr("width")
|
||||
.removeAttr("height")
|
||||
.css("width","")
|
||||
.css("height", "");
|
||||
|
||||
if($(this).data("width") == undefined)
|
||||
$(this).data("width", $(this).width());
|
||||
|
||||
if($(this).data("width") > width) {
|
||||
$(this).css("width", "100%");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(window).on("resize", function() {
|
||||
image_resize();
|
||||
});
|
||||
|
||||
image_resize();
|
||||
}
|
||||
}(jQuery));
|
||||
@ -47,4 +47,47 @@
|
||||
image_resize();
|
||||
});
|
||||
}
|
||||
|
||||
$.fn.viewimageresize2 = function(selector)
|
||||
{
|
||||
var cfg = {
|
||||
selector: "img"
|
||||
};
|
||||
|
||||
if(typeof selector == "object") {
|
||||
cfg = $.extend(cfg, selector);
|
||||
} else {
|
||||
if(selector) {
|
||||
cfg = $.extend({ selector: selector });
|
||||
}
|
||||
}
|
||||
|
||||
var $img = this.find(cfg.selector);
|
||||
var $this = this;
|
||||
|
||||
function image_resize()
|
||||
{
|
||||
var width = $this.width();
|
||||
|
||||
$img.each(function() {
|
||||
$(this).removeAttr("width")
|
||||
.removeAttr("height")
|
||||
.css("width","")
|
||||
.css("height", "");
|
||||
|
||||
if($(this).data("width") == undefined)
|
||||
$(this).data("width", $(this).width());
|
||||
|
||||
if($(this).data("width") > width) {
|
||||
$(this).css("width", "100%");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(window).on("resize", function() {
|
||||
image_resize();
|
||||
});
|
||||
|
||||
image_resize();
|
||||
}
|
||||
}(jQuery));
|
||||
Reference in New Issue
Block a user