首页 > 代码库 > jssor/slider图片的问题
jssor/slider图片的问题
用jssor/slider这个控件,在显示图片的时候,每张图片都被拉伸到最大的图片的宽度和高度,导致变形,怎么处理?
【答案】
Yes. With no u="image" image will keep original size (or the size specified by css manually).
function ShowSlideShows(fileIds) { var fileIdArray = fileIds.split(","); if( fileIdArray && Array.isArray(fileIdArray) ) { $("#slides").html(""); $(fileIdArray).each(function(index,element) { if( element ) { var div = $(‘<div>‘); div.attr("data-p", "225.00"); div.attr("style","display: none;"); var img = $(‘<img>‘); img.attr(‘src‘, ‘/imageapi/‘+element); //img.attr("data-u","image"); img.appendTo(div); div.appendTo(‘#slides‘); } }); ShowSlideShowOriginal(); } } |
jssor/slider图片的问题