[英]Hero Image Hides Content Until Scroll
嘗試這個,
更新
$(document).ready(function() {
var $winwidth = $(window).width();
$("img.source-image").attr({
width: $winwidth
});
$(window).bind("resize", function(){
var $winwidth = $(window).width();
var $winheight = $(window).height();
$("img.source-image").css({
'width': $winwidth,'height':$winheight
});
});
});
上面的腳本使圖像寬度根據屏幕寬度而變化
和CSS
img.source-image {
position: absolute;
top: 0;
left: 0;
}
要么
#img.source-image {
width: 100%;
position: absolute;
top: 0;
left: 0;
}
欲了解更多信息,請點擊此鏈接
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.