浏览器对width与height的最大值限制
在IE8与opera10-中,数字一旦大于1342177.27,都将自动被变成1342177.27这个数,其他见下面的注释部分。
var zooms = [ [ "256px" , "256px" ] , [ "512px" , "512px" ] , [ "1024px" , "1024px" ] , [ "2048px" , "2048px" ] , [ "4096px" , "4096px" ] , [ "8192px" , "8192px" ] , [ "16384px" , "16384px" ] , [ "32768px" , "32768px" ] , [ "65536px" , "65536px" ] , [ "131072px" , "131072px" ] , [ "262144px" , "262144px" ] , [ "524288px" , "524288px" ] , [ "1048576px" , "1048576px" ] , [ "2097152px" , "2097152px" ] , [ "4194304px" , "4194304px" ] , [ "8388608px" , "8388608px" ] , [ "16777216px" , "16777216px" ] , [ "33554432px" , "33554432px" ] , //firefox3.6.12渲染错误,变成长方形 [ "67108864px" , "67108864px" ] , [ "134217728px" , "134217728px" ] ]; //safari5.0.3, chrome10.0.6, opera10.62显示不能,失去背景色 function setZoom(el,zoom) { var width = zoom[0], height = zoom[1]; el.style.width = width; el.style.height = height; el.innerHTML= "设置值为 " + width + " x " + height + "<br>实际值为 " + el.style.width + " x " + el.style.height; }; function test(el){ var zoom = zooms.shift(); setZoom(el,zoom); if (zooms.length){ setTimeout( function (){ test(el) },2000); } } window.onload = function (){ var el = document.getElementById( "test" ); test(el); } |
机器瞎学/数据掩埋/模式混淆/人工智障/深度遗忘/神经掉线/计算机幻觉/专注单身二十五年
posted on 2011-02-16 15:33 司徒正美 阅读(3672) 评论(5) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
2010-02-16 ECMAScript 5与HTML5 的支持情况