随笔分类 - 移动端开发
CSS3,HTML5,Andriod,ios
摘要:1.图片自动等比例缩放{display:block;width:100%; height:auto;}
阅读全文
摘要:手机识别:varisAndroid=navigator.appVersion.toLowerCase().indexOf(‘android’)>=0,isIphone=navigator.appVersion.toLowerCase().indexOf(‘iphone’)>=0;if(isAndroid){window.location.href=”XXX.html”;}
阅读全文
摘要:用CSS判断横屏竖屏问题。CSS代码如下1、@media (orientation: portrait) { } 横屏@media (orientation: landscape) { }竖屏2、横屏竖屏用JavaScript判断横屏竖屏问题。JavaScript代码如下//判断手机横竖屏状态:function hengshuping(){if(window.orientation==180||window.orientation==0){alert("竖屏状态!") }if(window.orientation==90||window.orientation==-90){
阅读全文