首页 > 代码修改 > 点点站点可用的屏风代码
2012
08-24

点点站点可用的屏风代码

屏风代码 兼容WEBKIT

 #postit{ 
          
position:absolute; 
          
width:1000;height:500; 
          
padding:0px; 
          
background-color:000000; 
          
border:0px solid black; 
          
visibility:hidden; 
          
z-index:100; 
          
cursor:hand; 
          
}

<table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> 
         
<div id="postit" style="left:10px;top:10px;width=1100">  
         
<div align="center"><b><a href="javascript:closeit()"><img src="https://x.libdd.com/farm1/16c061/152e752c/45364574.JPG" border="0" alt="" /></a></b></div></table>

 

<script> 
var once_per_browser=0 
var ns4=document.layers 
var ie4=document.all 
var ns6=document.getElementById&&!document.all 
if (ns4) 
crossobj=document.layers.postit 
else if (ie4||ns6) 
crossobj=ns6? document.getElementById("postit") : document.all.postit 
function closeit(){ 
if (ie4||ns6) 
crossobj.style.visibility="hidden"
else if (ns4) 
crossobj.visibility="hide"
} 
function get_cookie4(Name) { 
  var search = Name + "="
  var returnvalue = ""; 
  if (document.cookie4.length > 0) { 
    offset = document.cookie4.indexOf(search) 
    if (offset != -1) { // if cookie4 exists 
      offset += search.length 
      // set index of beginning of value 
      end = document.cookie4.indexOf(";", offset); 
      // set index of end of cookie4 value 
      if (end == -1) 
         end = document.cookie4.length; 
      returnvalue=unescape(document.cookie4.substring(offset, end)) 
      } 
   } 
  return returnvalue; 
}// 
function showornot(){ 
if (get_cookie4('postdisplay')==''){ 
showit() 
document.cookie4="postdisplay=yes"
} 
} 
function showit(){ 
if (ie4||ns6) 
crossobj.style.visibility="visible"
else if (ns4) 
crossobj.visibility="show"
} 
if (once_per_browser) 
showornot() 
else
showit() 
</script> 
<script language="JavaScript1.2"> 
//drag drop function for ie4+ and NS6//// 
///////////////////////////////// 
function drag_drop(e){ 
if (ie4&&dragapproved){ 
crossobj.style.left=tempx+event.clientX-offsetx 
crossobj.style.top=tempy+event.clientY-offsety 
return false
}// 
else if (ns6&&dragapproved){ 
crossobj.style.left=tempx+e.clientX-offsetx 
crossobj.style.top=tempy+e.clientY-offsety 
return false
} 
}//
function initializedrag(e){ 
if (ie4&&event.srcElement.id=="postit"||ns6&&e.target.id=="postit"){ 
offsetx=ie4? event.clientX : e.clientX 
offsety=ie4? event.clientY : e.clientY 
tempx=parseInt(crossobj.style.left) 
tempy=parseInt(crossobj.style.top) 
dragapproved=true
document.onmousemove=drag_drop 
} 
}//
document.onmousedown=initializedrag 
document.onmouseup=new Function("dragapproved=false") 
</script>

本代码来自点点网友的博客,欢迎使用!

最后编辑:
作者:xindao
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。