html5 中meta中 content=width=device-width注意
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
<style>
body { margin:0; font-size: 13px; font-family: sans-serif; color:#333; line-height: 1.5; background: #fff;}
div{ margin:0;}
a{-webkit-tap-highlight-color:transparent; color:inherit;}
.jesgoo-ad-container { width: 100%; height: 100%; overflow: hidden;}
.jesgoo-content { position: absolute; left: 0; top: 0; width: 100%; height: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; text-decoration: none; }
.jesgoo-icon { float: left; border: none; width: 36px; height: 36px; margin:6px 0 0 12px; border-radius: 6px; overflow: hidden;}
.jesgoo-text{ float: left; padding-left: 10px; padding-top: 6px; width: 210px; overflow: hidden;}
.jesgoo-text.text { width: 260px; }
.jesgoo-title, .jesgoo-desc { white-space: nowrap; overflow: hidden; text-overflow:ellipsis;}
.jesgoo-title { font-weight: 800;}
.jesgoo-desc { color: #666; font-size: 12px; }
.jesgoo-desc marquee{ /*text-indent: -180px;*/}
.jesgoo-btn{ position: absolute; width: 40px; line-height: 24px; text-align: center; right: 12px; top: 50%; margin-top: -12px; color:#fff; font-style: normal; border-radius: 4px; background: #2e97ea; display: none;}
</style>
<script type="text/javascript">
window.onload = function(){
var containerId = 'jesgoo-id-container';
var resetSize = function () {
var containerEle = document.getElementById(containerId);
var win = window;
var winW = win.innerWidth;
var winH = win.innerHeight;
var fzW, fzH;
if (winW / winH < 5 / 2) {
fzW = winW / 300 * 20;
fzH = 1000;
}
else {
fzW = 1000;
fzH = winH / 96 * 20;
}
var fz = fzW > fzH ? fzH : fzW;
containerEle.style.fontSize = fz + 'px';
};
//resetSize();
var aEle = document.getElementById("jesgoo-link");
var attrJSON = aEle.getAttribute("extra");
var attrObj = eval("("+ attrJSON +")");
var btn = document.getElementById('jesgoo-btn');
if(attrObj.act == 2){
btn.innerHTML = "下载";
}else{
btn.innerHTML = "查看";
}
btn.style.display = "block"
}
</script>
</head>
<body>
<div id="jesgoo-id-container" class="jesgoo-container">
<a target="_blank" id="jesgoo-link" class="jesgoo-content" style="text-decoration: none;" href=http://www.baidu.com extra="{'act':1,'pkg':'','title':'','adid':'0','durl':[''],'iurl':[''],'aurl':['']}">
<div class="jesgoo-text text">
<div class="jesgoo-title">分享:关键时刻不行怎么办</div>
<div class="jesgoo-desc"><marquee behavior="scroll" direction="left">只需一招 给她夜夜惊喜</marquee></div>
</div>
<i id="jesgoo-btn" class="jesgoo-btn">下载</i>
</a>
</div>
</body>
</html>
以上这个物料在ios 320*50的UIWebView iphone的设备上(iPhone5 iPhone4)上右侧有下载或查看按键
但是 这个物料在ios 320*50的UIWebView ipad的设备上 没有看到右侧按键
原因是下面的 content="width=device-width, user-scalable=no, initial-scale=1.0" 设置的content的宽为设备的宽度 button的位置是做了对右偏移的控制 在ipad上device-width 是728 实际button的x位置是716 但是webview 只有320宽度,所以看不到了。使用中注意这个。
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
<style>
html5 中meta中 content=width=device-width注意的更多相关文章
- <head>中<meta name="viewport" content="width=device-width,initical-scale=1"的作用>
<meta name="viewport" content="width=device-width,initical-scale=1"的作用> co ...
- HTML5移动开发中的meta与link
meta HTML5移动开发中的一些webkit专属头部标签,能够帮助浏览器更好的解析HTML代码,从而为HTML5移动开发提供更好的前端表现与体验 viewport网页缩放 1 <meta n ...
- HTML5头部标签中<meta>常用信息
整理一些平时常用的,方便查阅 <!-- 字体编码 --> <meta charset="utf-8" /> <!-- 关键字 --> <m ...
- 如何理解VB窗体中的scale类属性及width height属性之间的关系
如何理解VB窗体中的scale类属性及width height属性之间的关系 VB中的SCALEHIEGT,SCALEWIDTH,与窗体中的WIDTH,HEIGHT的区别及关系是许多VB初学者难以理解 ...
- HTML5在canvas中绘制复杂形状附效果截图
HTML5在canvas中绘制复杂形状附效果截图 一.绘制复杂形状或路径 在简单的矩形不能满足需求的情况下,绘图环境提供了如下方法来绘制复杂的形状或路径. beginPath() : 开始绘制一个新路 ...
- HTML中<meta>标签如何正确使用
HTML中<meta>标签如何正确使用 如果我们在浏览器中按下F12或者Ctrl+shift+J,便可以打开开发者工具,在element中即可看到<head>元素中有不少< ...
- 我刚知道的WAP app中meta的属性
之前我一直做的都是WEB前端开发,来北京以后面试了一个移动前端开发,WAP前端开发. 其实在原来公司的时候也做过这方面的开发,可面试的时候面试官问我,要想强制让文档与设备的宽度保持1:1,mate标签 ...
- 我刚知道的WAP app中meta的属性(转载)
之前我一直做的都是WEB前端开发,来北京以后面试了一个移动前端开发,WAP前端开发. 其实在原来公司的时候也做过这方面的开发,可面试的时候面试官问我,要想强制让文档与设备的宽度保持1:1,mate标签 ...
- html中meta标签及用法理解
自己一直想成为高级前端开发工程师,而自学.奈何最近感觉自学收效甚微,一度迷茫. 不破不立,打算改变这样的状态. 春节后上班第一天,今年打算好好实现自己的前端梦想. 重新整理.总结前端技术. 废话,就不 ...
随机推荐
- hilbert矩阵
希尔伯特矩阵 希尔伯特矩阵是一种数学变换矩阵 Hilbert matrix,矩阵的一种,其元素A(i,j)=1/(i+j-1),i,j分别为其行标和列标. 即: [1,1/2,1/3,……,1/n] ...
- makefile--统一目标输出目录 (六)
原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/ 上一节我们把规则单独提取出来,方便了Makefile的维护,每个模块只需要给出关于自己的一些变量 ...
- hadoop常用管理员命令
hadoop job -list 列出正在运行的job hadoop job -kill kill掉job hadoop fsck 检查HDFS坏快 hadoop dfsadmin -report检查 ...
- hihoCoder:#1079(线段树+离散化)
题目大意:给n个区间,有的区间可能覆盖掉其他区间,问没有完全被其他区间覆盖的区间有几个?区间依次给出,如果有两个区间完全一样,则视为后面的覆盖前面的. 题目分析:区间可能很长,所以要将其离散化.但离散 ...
- kuangbin_UnionFind A (POJ 2236)
挺接近模板的一题 接受O操作的时候扫一遍 符合条件的merge进去 done #include <cstdio> #include <cstring> #include < ...
- 黑马程序员——JAVA基础之构造函数,构造代码块
------- android培训.java培训.期待与您交流! ---------- 构造函数特点: 1. 函数名与类名相同 2. 不用定义返回值类型 3. 不可以写return语句 构造函数 ...
- 论文笔记之:Deep Reinforcement Learning with Double Q-learning
Deep Reinforcement Learning with Double Q-learning Google DeepMind Abstract 主流的 Q-learning 算法过高的估计在特 ...
- Mysql源码目录结构
Programs for handling SQL commands. The "core" of MySQL. These are the .c and .cc files in ...
- 20150906VS小知识
.sln :解决方案管理文件.caproj:项目管理文件.cs:程序源代码文件项目文件目录下有个bin文件夹,里面的debug文件夹,里面存放生成后的程序. //注释一行/* */ 注释一段 alt ...
- jQuery Mobile_页面事件
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...