在网页里做类似window右键的弹出式菜单
做一个类似于window右键的弹出式菜单。 织梦好,好织梦
代码如下:
var obj; 织梦好,好织梦
function loadobj(o)
{
obj=o;
} copyright dedecms
function expand()
{
var h=parseInt(obj.height);
var w=parseInt(obj.width);
var op=10; dedecms.com
if( h<=170 )
{
if( w<60 )
obj.style.width=w 6; 织梦内容管理系统
obj.style.height=h 17;
x=setTimeout('expand()', 25);
}
else
{
obj.style.width=60;
obj.style.height=174;
clearTimeout(x);
}
} 内容来自dedecms
var drag=0;
var move=0;
function Dblclick()
{
if (event.button==0)
{
obj.style.visibility="visible";
obj.style.left=window.event.x;
obj.style.top =window.event.y;
obj.style.width=0;
obj.style.height=0;
obj.filters.item(0).apply();
obj.filters.item(0).transition = 25;
obj.filters(0).play(0.5); copyright dedecms
expand();
}
}
function MouseMove()
{
if(move==1)
{
obj.style.cursor="move";
obj.style.left=window.event.x-l;
obj.style.top=window.event.y-t;
}
}
function MouseDown()
{
if(drag)
{
l = window.event.x - parseInt(obj.style.left);
t = window.event.y - parseInt(obj.style.top);
obj.style.zIndex =1;
move=1;
}
else
{
document.body.style.cursor='default';
obj.style.visibility='hidden';
}
}
function MouseStop()
{
window.event.returnValue=false;
}
copyright dedecms
function MouseUp()
{
move=0;
obj.style.cursor="hand";
} 本文来自织梦
document.ondblclick=Dblclick;
document.onmousedown=MouseDown;
document.onmousemove=MouseMove;
document.ondragstart=MouseStop;
document.onmouseup=MouseUp;
本文来自织梦
文章评论
共有位Admini5网友发表了评论 查看完整内容