[原创]php+ajax实现模拟Win文件管理系统
//本教程由本站原创,转载请注明来处
作者:www.drise.cn
邮箱: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","
}
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="
ShowMenu(obj,0,0);
return false;
}
document.onmousemove=hiddenSubMenu;
attachEvent('onload', loadsubMenu);// JavaScript Document//等一下只要这样调用就行了.
上一篇