?? nine.html
字號:
<style>
</style>
<body>
<script>
function ImageBox(url,height,width)
{
var ret=document.createElement("div");
ret.style.overflow="hidden";
ret.style.height=height;
ret.style.width=width;
//ret.style.background="blue";
if(url.indexOf("png")&& (navigator.appVersion.indexOf("MSIE 6.0")>-1) )
ret.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+url+"\",sizingMethod=\"scale\")";
else
ret.style.background="url(\""+url+"\")";
return ret;
}
function borderedDiv(content,images,border)
{
var container=document.createElement("div");
container.style.width=parseInt(border.left)+parseInt(content.style.width)+parseInt(border.right);
//container.style.border="solid 1px green";
//container.style.position="absolute";
var height=[border.top,content.style.height,border.bottom];
var width=[border.left,content.style.width,border.right];
var float=["left","left","left"];
for(var x=0;x<3;x++)
{
var line=document.createElement("div");
container.appendChild(line);
//line.style.border="solid 1px green";
line.style.height=height[x];
for(var y=0;y<3;y++)
{
if(x!=1||y!=1)
var curr=new ImageBox(images[x][y],height[x],width[y]);
else
curr=content;
if(navigator.appName==("Microsoft Internet Explorer"))curr.style.styleFloat=float[y];
else curr.style.cssFloat="left";
curr.style.overflow="hidden";
line.appendChild(curr);
}
}
return container;
}
window.onload=function()
{
//document.body.appendChild(pic);
var nine=borderedDiv(document.getElementById("id1"),[
["t1.png","t2.png","t3.png"],
["l1.png",0,"r1.png"],
["l2.png","b1.png","r2.png"]
],{
"top":"35px",
"left":"15px",
"bottom":"15px",
"right":"15px"
}
);
document.body.appendChild(nine);
}
</script>
<div id="id1" style="width:100px;height:100px;background:black;color:silver;">a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a</div>
</body>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -