備忘錄_20160105(定位)
修改
回首頁
程式 2019-09-30 20:49:10 1569847750 100
html basic template 網頁基本樣板 part 01 - 純框架
html basic template 網頁基本樣板 part 01 - 純框架
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
*
{
font-family: "WenQuanYi Zen Hei","文泉驛正黑","Heiti TC","黑體-繁","LiHei Pro","儷黑 Pro","PingFang TC","Droid Sans","Roboto","Microsoft JhengHei","微軟正黑體",sans-serif;
/* 【linux的字型】【ios字型】【android字型】【微軟正黑體】【無襯線字=黑體】 */
}
a:link, a:visited
{
color: blue;
text-decoration: none;
}
html, body
{
margin: 0;
border: 0;
padding: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
}
#divWrapper
{
display: block;
position: relative;
box-sizing: border-box; /* content-box | padding-box | border-box */
margin: 0;
border: 0;
padding: 1em;
width: 100vw;
height: 100vh;
background-color: white;
overflow: auto;
}
</style>
</head>
<body>
<div id="divWrapper">
</div>
<script>
if(!String.prototype.ltrim) { String.prototype.ltrim = function() { return this.replace(/^\s+/,''); }; }
if(!String.prototype.rtrim) { String.prototype.rtrim = function() { return this.replace(/\s+$/,''); }; }
if(!String.prototype.trim ) { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,''); }; }
function gebi(strId)
{
return document.getElementById(strId);
}
window.addEventListener(
"load",
function()
{
}
);
</script>
<script>
function getStrCurrentPath()
{
var str1=window.location.origin;
var str2=window.location.pathname;
var iIdx=str2.lastIndexOf("/");
if(iIdx!=-1) { str2=str2.substring(0, iIdx); }
return (str1+str2); // 如 https://abc.com:8888/test
}
function test()
{
var stra1=[];
for(var i=0; i<100; i++)
{
stra1.push("<pre>");
for(var j=0; j<100; j++)
{
stra1.push("hello "+i+","+j);
}
stra1.push("</pre>");
}
gebi("divWrapper").innerHTML=stra1.join("");
}
test();
</script>
</body>
</html>