[原创]php+ajax实现模拟Win文件管理系统
//本教程由本站原创,转载请注明来处
作者:www.111cn.net
邮箱:drise@163.com
QQ:271728967
//
上面php文件讲完了,下面来讲一下,document.js文件.些文件来自互联网.
var subMenuSrcObj=null;
function ShowMenu(obj,x,y){
try{
subMenuSrcObj=obj;
document.getElementById("subMenu").style.top=(ie_y(obj)+obj.offsetHeight+y)+"px";
document.getElementById("subMenu").style.left=(ie_x(obj)+x)+"px";
}catch(e)
{ ;
}
}
function loadsubMenu()
{
document.body.insertAdjacentHTML("afterBegin","<div id=\"subMenu\" style=\"filter:progid:DXImageTransform.Microsoft.DropShadow(color=#333333,offX=1,offY=1,positives=true);position:absolute; left:-10025px; top:47px; width:100px; height:1px;background-color: #D4D0C8;z-index:99999\">s</div>");
}
function hiddenSubMenu1()
{
document.getElementById("subMenu").style.left="-9000px";
}
function hiddenSubMenu()
{
try
{
obj=document.getElementById("subMenu");
temp=false;
e=event.srcElement;
if(e==obj)
{
temp=false;
}else
{
temp=true;
while(e=e.offsetParent)
{
if(e==obj||e==subMenuSrcObj)
{
temp=false;
}
}
}
if(event.srcElement==subMenuSrcObj)
{
temp=false;
}
if(temp&&parseInt(obj.style.left)>0)
{
hiddenSubMenu1();
}
}
catch (e)
{
}
}
function ie_y(e){
var t=e.offsetTop;
while(e=e.offsetParent){
t+=e.offsetTop;
}
return t;
}
function ie_x(e){
var l=e.offsetLeft;
while(e=e.offsetParent){
l+=e.offsetLeft;
}
return l;
}
function del(){
}
function myMenuShow(obj,btn)
{
document.getElementById("subMenu").innerHTML="<li onMouseOver=\"this.style.backgroundColor='#F5FBFF'\" onMouseOut=\"this.style.backgroundColor=''\" onclick=\"alert('"+btn+"');\" >剪 切</li> <li onMouseOver=\"this.style.backgroundColor='#F5FBFF'\" onMouseOut=\"this.style.backgroundColor=''\">复 制</li><li onMouseOver=\"this.style.backgroundColor='#F5FBFF'\" onMouseOut=\"this.style.backgroundColor=''\" >粘 贴</li> <hr><li onMouseOver=\"this.style.backgroundColor='#F5FBFF'\" onMouseOut=\"this.style.backgroundColor=''\" onclick=\"del("+btn+");\">删 除</li> <hr><li onMouseOver=\"this.style.backgroundColor='#F5FBFF'\" onMouseOut=\"this.style.backgroundColor=''\" onclick=\"alert('你单击文件名就可重命名!');\" >重命名</li><br/>";
ShowMenu(obj,0,0);
return false;
}
document.onmousemove=hiddenSubMenu;
attachEvent('onload', loadsubMenu);// JavaScript Document//等一下只要这样调用就行了.
上一篇