社区
JavaScript
帖子详情
这种菜单怎么做?
xuehuajian
2003-07-02 04:40:53
鼠标放在菜单上,横着出来下一级菜单!这个下一级菜单是动态生成的!
...全文
63
1
打赏
收藏
这种菜单怎么做?
鼠标放在菜单上,横着出来下一级菜单!这个下一级菜单是动态生成的!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
gq
2003-07-02
打赏
举报
回复
<script>
var menus = new Array();
var isShow = new Boolean();
isShow=false;
var isdown = new Boolean();
isdown=false;
var srcel;
var fromel;
var toel;
var usestatus=false;
var thestatus="";
var popTimer = 0;
menucolor='#EEBF99';fontcolor='MenuText';menuoutcolor='#F3D5B8';menuincolor='#F8E8D6';menuoutbordercolor='#FCF3EF';menuinbordercolor='#000000';midoutcolor='#F2D0B5';midincolor='#9E7F66';menuovercolor='#E80005';menuunitwidth=160;menuitemwidth=160;menuheight=180;menuwidth='160';menuadjust=0;
menualign='center';leftchar='(无)';rightchar='(无)';fonts='font-family: 宋体; font-size: 9pt; color: MenuText; ';cursor='default';
var fadeSteps = 5;
var fademsec = 20;
var fadeArray = new Array();
function fade(el, fadeIn, steps, msec) {
if (steps == null) steps = fadeSteps;
if (msec == null) msec = fademsec;
if (el.fadeIndex == null)
el.fadeIndex = fadeArray.length;
fadeArray[el.fadeIndex] = el;
if (el.fadeStepNumber == null) {
if (el.style.visibility == "hidden")
el.fadeStepNumber = 0;
else
el.fadeStepNumber = steps;
if (fadeIn)
el.style.filter = "Alpha(Opacity=0)";
else
el.style.filter = "Alpha(Opacity=100)";
}
window.setTimeout("repeatFade(" + fadeIn + "," + el.fadeIndex + "," + steps + "," + msec + ")", msec);
}
function repeatFade(fadeIn, index, steps, msec) {
el = fadeArray[index];
c = el.fadeStepNumber;
if (el.fadeTimer != null)
window.clearTimeout(el.fadeTimer);
if ((c == 0) && (!fadeIn)) {
el.style.visibility = "hidden";
return;
}
else if ((c==steps) && (fadeIn)) {
el.style.filter = "";
el.style.visibility = "visible";
return;
}
else {
(fadeIn) ? c++ : c--;
el.style.visibility = "visible";
el.style.filter = "Alpha(Opacity=" + 100*c/steps + ")";
el.fadeStepNumber = c;
el.fadeTimer = window.setTimeout("repeatFade(" + fadeIn + "," + index + "," + steps + "," + msec + ")", msec);
}
}
function popOut() {
popTimer = setTimeout('allhide()', 1000);
}
function getReal(el, type, value) {
temp = el;
while ((temp != null) && (temp.tagName != "BODY")) {
if (eval("temp." + type) == value) {
el = temp;
return el;
}
temp = temp.parentElement;
}
return el;
}
function MenuRegister(menu)
{
menus[menus.length] = menu
return (menus.length - 1)
}
function MenuItem(caption,command,target,isline,statustxt){
this.caption=caption;
this.command=command;
this.target=target;
this.isline=isline;
this.statustxt=statustxt;
}
function Menu(caption,command,target){
this.items = new Array();
this.caption=caption;
this.command=command;
this.target=target;
this.id=MenuRegister(this);
}
function MenuAddItem(item)
{
this.items[this.items.length] = item
item.parent = this.id;
this.children=true;
}
Menu.prototype.addItem = MenuAddItem;
function toout(src){
src.style.borderLeftColor=menuoutbordercolor;
src.style.borderRightColor=menuinbordercolor;
src.style.borderTopColor=menuoutbordercolor;
src.style.borderBottomColor=menuinbordercolor;
src.style.backgroundColor=menuoutcolor;
src.style.color=menuovercolor;
}
function toin(src){
src.style.borderLeftColor=menuinbordercolor;
src.style.borderRightColor=menuoutbordercolor;
src.style.borderTopColor=menuinbordercolor;
src.style.borderBottomColor=menuoutbordercolor;
src.style.backgroundColor=menuincolor;
src.style.color=menuovercolor;
}
function nochange(src){
src.style.borderLeftColor=menucolor;
src.style.borderRightColor=menucolor;
src.style.borderTopColor=menucolor;
src.style.borderBottomColor=menucolor;
src.style.backgroundColor=menucolor;
src.style.color=fontcolor;
}
function allhide(){
for(var nummenu=0;nummenu<menus.length;nummenu++){
var themenu=document.all['menu'+nummenu]
var themenudiv=document.all['menudiv'+nummenu]
nochange(themenu);
menuhide(themenudiv);
}
}
function menuhide(menuid){
fade(menuid,false,6);
isShow=false;
}
function menushow(menuid,pid){
menuid.style.left=menutable.offsetLeft+menuadjust+parseInt(menuwidth);menuid.style.top=menutable.offsetTop+pid.offsetTop;fade(menuid,true,6);
isShow=true;
}
function menu_over(menuid,x){
toEl = getReal(window.event.toElement, "className", "coolButton");
fromEl = getReal(window.event.fromElement, "className", "coolButton");
if (toEl == fromEl) return;
srcel = window.event.srcElement;
if(menus[x].command==""){
allhide();
toin(srcel);
menushow(menuid,eval("menu"+x));
}else{
isShow = false;
allhide();
toout(srcel);
}
clearTimeout(popTimer);
}
function menu_out(menuid){
toEl = getReal(window.event.toElement, "className", "coolButton");
fromEl = getReal(window.event.fromElement, "className", "coolButton");
if (toEl == fromEl) return;
srcel = window.event.srcElement;
if (isShow){
toin(srcel);
}else{
nochange(srcel);
}
popOut()
}
function menu_down(menuid,x){
srcel = getReal(window.event.srcElement, "className", "coolButton");
if(menus[x].command==""){
if(isShow){
menuhide(menuid);
toout(srcel);
}
else{
toin(srcel);
menushow(menuid,eval("menu"+x));
isdown=true;
}
}else{
toin(srcel);
isdown=true;
}
}
function menu_up(){
isdown=false;
}
function menuitem_over(menuid){
srcel = getReal(window.event.srcElement, "className", "coolButton");
if(isdown){
toin(srcel);
}
else{
toout(srcel);
}
if(thestatus!=""){
usestatus=true;
window.status=thestatus;
}
clearTimeout(popTimer);
}
function menuitem_out(menuid){
srcel = getReal(window.event.srcElement, "className", "coolButton");
nochange(srcel);
if(usestatus)window.status="";
popOut()
}
function menuitem_down(menuid){
srcel = getReal(window.event.srcElement, "className", "coolButton");
toin(srcel)
isdown=true;
}
function menuitem_up(menuid){
srcel = getReal(window.event.srcElement, "className", "coolButton");
toout(srcel)
isdown=false;
}
function exec2(x){
var cmd;
if(menus[x].target=="blank"){
cmd = "window.open('"+menus[x].command+"')";
}else{
cmd = menus[x].target+".location='"+menus[x].command+"'";
}
eval(cmd);
}
function exec(x,i){
var cmd;
if(menus[x].items[i].target=="blank"){
cmd = "window.open('"+menus[x].items[i].command+"')";
}else{
cmd = menus[x].items[i].target+".location='"+menus[x].items[i].command+"'";
}
eval(cmd);
}
怎么
做
.css下拉
菜单
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> http://www.w3.org/1999/xhtml" lang="zh-CN"> css
菜单
演示 /* common styling *//* set up the overall width of the menu
python
菜单
怎么
做
_python添加
菜单
图文讲解
分享一个基于tkinter的
菜单
程序添加操作,希望对需要的朋友有帮助。打开python集成开发环境,使用from tkinter import Tkfrom tkinter import Menu导入Tk和Menu,最好不要用from tkinter import *因为这样可能刀座某些平台不兼容,比如树莓派就需要单个导入。使用root = Tk()新建一个Tk对象并赋值给root,然后再通过te...
c语言怎么
做
界面
菜单
_excel的下拉
菜单
多项选择怎么
做
在
做
excle表格很容易遇到多项进行下拉
菜单
的选择,免去了大量的输入时间,而且还不容易打错字而造成的后果。那么,excel的下拉
菜单
多项选择怎么
做
?具体步骤是怎样的?下面小编来告诉你下拉
菜单
多项选择怎么
做
吧。希望对你有帮助! 第一步:先选定其中一个需要多项选择下拉
菜单
的单元格,点击excle上的数据选项栏——数据有效性——选中下拉中的数据有效性excel制作下拉
菜单
多项选择的步骤图1...
java怎么二级
菜单
_怎么
做
二级
菜单
java
我写的代码,不知为何,鼠标放到“主题美化”上面,弹出的
菜单
就消失了。代码可以直接复制运行,求大神指教。packagecom.rollnews.test;importjava.awt.event.MouseAdapter;importjav...我写的代码,不知为何,鼠标放到 “主题美化” 上面,弹出的
菜单
就消失了。代码可以直接复制运行,求大神指教。package com.rollnews.test...
pycharm怎么
做
html网页_html下拉
菜单
怎么
做
很多人学习html之后,想动手实践一下一些特效,很多人都想写二级
菜单
,那么,html下拉
菜单
怎么
做
?今天就来分享一下下拉
菜单
怎么
做
?程序猿的生活:打造全网web前端全栈资料库(总目录)看完学的更快,掌握的更加牢固,你值得拥有(持续更新)zhuanlan.zhihu.com二级
菜单
其实并不难,一般情况下都是使用li标签和ul标签配合使用,第一步首先我们要先把html的结构写出来,包含头部和主体部分...
JavaScript
87,987
社区成员
224,683
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章