function theNewImg_onload(){ $bgimg.data("newImageW",this.width).data("newImageH",this.height); BackgroundLoad($bgimg,this.width,this.height,this.src); } //Image scale function function FullScreenBackground(theItem,imageWidth,imageHeight){ var showwidth=$("#layout").width();//获得显示区域的宽度 var showheight=$("#layout").height();//获得显示区域的高度 //计算出缩小或者放大的比例 var bili=showwidth/imageWidth; var winWidth=$(window).width(); //获得浏览器高和宽 //alert("当前分辨率宽"+winWidth); var winHeight=$(window).height(); $(theItem).attr("width",showwidth); $(theItem).attr("height",imageHeight*bili); //alert("显示区域高"+showheight+" ,显示区域宽"+showwidth+",图片缩小或者放大了"+bili+" ,原图片高"+imageHeight+",宽"+imageWidth+",缩小或放大后图片高"+imageHeight*bili+",宽"+showwidth+"。请用计算器算出适合图片大小,实际上,只要根据显示区域比例来做图片。绝对保证图片永久不变形。"); }
Copyright © 2004-2024 Ynicp.com 版权所有 法律顾问:建纬(昆明)律师事务所 昆明市网翼通科技有限公司 滇ICP备08002592号-4