网页效果

来源:百度知道 编辑:UC知道 时间:2024/05/21 04:54:07
像百度这样的效果是怎么实现的!!请各位帮忙!!

<script type="text/javascript">
var docEle = function()
{
return document.getElementById(arguments[0]) || false;
}

function openNewDiv(_id)
{
var m = "mask";
if (docEle(_id)) document.body.removeChild(docEle(_id));
if (docEle(m)) document.body.removeChild(docEle(m));

//mask遮罩层

var newMask = document.createElement("div");
newMask.id = m;
newMask.style.position = "absolute";
newMask.style.zIndex = "1";
_scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
_scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
newMask.style.width = _scrollWidth + "px";
newMask.style.height = _scrollHeight + "px";
newMask.style.top = "0px";
newMask.style.left = "