jquery 全屏幻灯片 fullsizable GTX增强版 不拉伸图片

if (image.ratio == null) {
image.ratio = (image.naturalHeight / image.naturalWidth).toFixed(2);
}
if ($(window).height() / image.ratio > $(window).width()) {
$(image).width($(window).width());
$(image).height($(window).width() * image.ratio);
return $(image).css('margin-top', ($(window).height() - $(image).height()) / 2);
} else {
//都执行了这块代码 var max = $("#jquery-fullsizable").height();
var imgh = $(image).context.height;
var mtop = 0;
if (imgh >= max) {
mtop = 0;
} else {
mtop = parseInt((max - imgh) / 2);css

}  
	console.log(mtop);  
	// $(image).height($(window).height());  
	//  $(image).width($(image).width);  
	return $(image).css('margin-top', mtop);  
}

官方地址http://plugins.jquery.com/fullsizable/ githubhttps://github.com/MSchmidt/jquery-fullsizablejquery

相关文章
相关标签/搜索