星空网 > 软件开发 > Java

背景图自适应窗口大小

<script type="text/javascript">
window.onresize = window.onload = function()
{
var w,bgImg;
if(!!(window.attachEvent && !window.opera)) {
w = document.documentElement.clientWidth;
} else {
w = window.innerWidth;
}if(w>1650){
document.getElementById ('msg').value ='窗口大小:' + 'width:' + w;
bgImg = document.getElementById('bg').getElementsByTagName('img')[0];
bgImg.width = (w - 5);
}else{
document.getElementById ('msg').value ='窗口大小:' + 'width:' + w;
bgImg = document.getElementById('bg').getElementsByTagName('img')[0];
bgImg.width = 1650;
}

}
</script>


根据窗口大小调整背景图片的大小



原标题:背景图自适应窗口大小

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

一张蔬菜的港澳通行证:https://www.kjdsnews.com/a/1335685.html
香港公司为何注册官费缘何突然上涨2000元?港府缺钱了吗?:https://www.kjdsnews.com/a/1335686.html
产品的部分也可以申请专利?日本部分外观设计专利快来了解!:https://www.kjdsnews.com/a/1335687.html
深圳CCEE春季展亮点4:玩“赚”俄罗斯——Ozon+Joom官方携资深大卖“指点迷津”:https://www.kjdsnews.com/a/1335688.html
深圳大卖被恶意攻击!悬赏30万找“黑手”:https://www.kjdsnews.com/a/1335689.html
分享6种tiktok选品技巧:https://www.kjdsnews.com/a/1335690.html
去日本入住酒店,东西随意用却有一个特殊“要:https://www.vstour.cn/a/411241.html
中国有哪些著名的酒店品牌。:https://www.vstour.cn/a/411242.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流