您现在的位置: 网页制作教程网 >> 网页特效 >> Javascript 教程 >> 文章正文

浮动菜单是如何作出来的mouse事件

作者:天极

来源:天极

热度:

2007-4-14 16:14:19

// 非公共函数,被其它的函数调用;

// Simple popup

function dts(d,text) {

txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=""+backcolor+""><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=""+fcolor+""><TR><TD><FONT FACE="宋体" COLOR=""+textcolor+"">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"

layerWrite(txt);

dir = d;

disp();

}

// Caption popup

function dtc(d,text, title) {

txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=""+backcolor+""><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID="PTT"><FONT COLOR=""+capcolor+"">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=""+fcolor+""><TR><TD><SPAN ID="PST"><FONT COLOR=""+textcolor+"">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"

layerWrite(txt);

dir = d;

disp();

}

// Sticky

function stc(d,text, title) {

sw = 1;

cnt = 0;

txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=""+backcolor+""><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID="PTT"><FONT COLOR=""+capcolor+"">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF="/" onMouseOver="cClick();" ID="PCL"><FONT COLOR=""+closecolor+"">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=""+fcolor+""><TR><TD><SPAN ID="PST"><FONT COLOR=""+textcolor+"">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"

layerWrite(txt);

dir = d;

disp();

snow = 0;

}

// Common calls

function disp() {

if ( (ns4) || (ie4) ) {

if (snow == 0) {

if (dir == 2) { // Center

moveTo(over,x+offsetx-(width/2),y+offsety);

}

if (dir == 1) { // Right

moveTo(over,x+offsetx,y+offsety);

}

if (dir == 0) { // Left

moveTo(over,x-offsetx-width,y+offsety);

}

showObject(over);

snow = 1;

}

}

// Here you can make the text goto the statusbar.

}

// Moves the layer

function mouseMove(e) {

if (ns4) {x=e.pageX; y=e.pageY;}

if (ie4) {x=event.x; y=event.y;}

if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}

if (snow) {

if (dir == 2) { // Center

moveTo(over,x+offsetx-(width/2),y+offsety);

}

if (dir == 1) { // Right

moveTo(over,x+offsetx,y+offsety);

}

if (dir == 0) { // Left

moveTo(over,x-offsetx-width,y+offsety);

}

}

}

上一页  [1] [2] [3] [4] 下一页

我来说两句:

1分 2分 3分 4分 5分
姓名: *


* 请各位网友遵纪守法并注意语言文明。
网站简介 | 联系方式 | 意见建议 | 版权说明
Copyright © 2007 All rights reserved
滇ICP备06006992号