Drop-down Transparent Menu Two

Source: Internet
Author: User

function Mmenu (caption,command,target,img,sizex,sizey,pos) {
This.items = new Array ();
This.caption=caption;
This.command=command;
This.target=target;
this.img=img;
This.sizex=sizex;
This.sizey=sizey;
This.pos=pos;
This.id=mmenuregister (this);
}
function Mmenuadditem (item)
{
This.items[this.items.length] = Item
Item.Parent = this.id;
This.children=true;
}

MMenu.prototype.addItem = Mmenuadditem;
MMenuItem.prototype.addsubItem = Mmenuadditem;

function Mtoout (SRC) {

Src.style.borderleftcolor=mmenuoutbordercolor;
Src.style.borderrightcolor=mmenuinbordercolor;
Src.style.bordertopcolor=mmenuoutbordercolor;
Src.style.borderbottomcolor=mmenuinbordercolor;
Src.style.backgroundcolor=mmenuoutcolor;
Src.style.color=mmenuovercolor;
}
function Mtoin (SRC) {

Src.style.borderleftcolor=mmenuinbordercolor;
Src.style.borderrightcolor=mmenuoutbordercolor;
Src.style.bordertopcolor=mmenuinbordercolor;
Src.style.borderbottomcolor=mmenuoutbordercolor;
Src.style.backgroundcolor=mmenuincolor;
Src.style.color=mmenuovercolor;
}
function Mnochange (SRC) {
Src.style.borderleftcolor=mmenucolor;
Src.style.borderrightcolor=mmenucolor;
Src.style.bordertopcolor=mmenucolor;
Src.style.borderbottomcolor=mmenucolor;
Src.style.backgroundcolor= ';
Src.style.color=mfontcolor;

}
function Mallhide () {
for (Var nummenu=0;nummenu<mmenus.length;nummenu++) {
var themenu=document.all[' Mmenu ' +nummenu]
var themenudiv=document.all[' Mmenudiv ' +nummenu]
Mnochange (Themenu);
Mmenuhide (THEMENUDIV);
}
for (nummenu=1;nummenu<=mnumberofsub;nummenu++) {
var thesub=document.all[' Msubmenudiv ' +nummenu]
Msubmenuhide (thesub);
Mnochange (document.all[' MP ' +nummenu]);
document.all["Mitem" +nummenu].style.color=mfontcolor;
}
}
function Mmenuhide (MENUID) {
Menuid.style.filter= ' Alpha (opacity=100) ';
Hideswipe (MENUID);
Misshow=false;
}
function Msubmenuhide (MENUID) {
Menuid.style.filter= ' Alpha (opacity=100) ';
menuid.style.visibility= ' hidden ';
}
function Mmenushow (menuid,pid) {
Menuid.style.filter= ' Alpha (opacity=80) ';
menuid.style.left=mposflag.offsetleft+pid.offsetleft+mmenuadjust;menuid.style.top=mposflag.offsettop+ Mmenutable.offsetheight+mmenuadjustv;
if (Mmenuitemwidth+parseint (menuid.style.left) >document.body.clientwidth+document.body.scrollleft)
Menuid.style.left=document.body.clientwidth+document.body.scrollleft-mmenuitemwidth;
Mtmpleft=menuid.style.left;mtmptop=menuid.style.top;swipe (menuid,2,4);
Misshow=true;
}
function Mshowsubmenu (Menuid,pid,rid) {
Menuid.style.filter= ' Alpha (opacity=80) ';
Menuid.style.left=pid.offsetwidth+rid.offsetleft;
menuid.style.top=pid.offsettop+rid.offsettop-3;
if (Mmenuitemwidth+parseint (menuid.style.left) >document.body.clientwidth+document.body.scrollleft)
Menuid.style.left=document.body.clientwidth+document.body.scrollleft-mmenuitemwidth;
menuid.style.visibility= ' visible ';
}
function Mmenu_over (menuid,x) {
Toel = Getreal (window.event.toElement, "ClassName", "Coolbutton");
Fromel = Getreal (window.event.fromElement, "ClassName", "Coolbutton");
if (Toel = = Fromel) return;
if (x<0) {
Misshow = false;
Mallhide ();
Mtoout (eval ("Mmenu" +x));
}else{

Mallhide ();
Mtoin (eval ("Mmenu" +x));
Mmenushow (Menuid,eval ("Mmenu" +x));

}
Cleartimeout (Mpoptimer);
}
function Mmenu_out (x) {
Toel = Getreal (window.event.toElement, "ClassName", "Coolbutton");
Fromel = Getreal (window.event.fromElement, "ClassName", "Coolbutton");
if (Toel = = Fromel) return;
if (misshow) {
Mtoin (eval ("Mmenu" +x));
}else{
Mnochange (eval ("Mmenu" +x));
}
Mpopout ()
}
function Mmenu_down (menuid,x) {
if (misshow) {
Mmenuhide (MENUID);
Mtoout (eval ("Mmenu" +x));
}
else{
Mtoin (eval ("Mmenu" +x));
Mmenushow (Menuid,eval ("Mmenu" +x));
Misdown=true;
}
}
function Mmenu_up () {
Misdown=false;
}
function Mmenuitem_over (menuid,item,x,j,i) {
Toel = Getreal (window.event.toElement, "ClassName", "Coolbutton");
Fromel = Getreal (window.event.fromElement, "ClassName", "Coolbutton");
if (Toel = = Fromel) return;
Srcel = Getreal (window.event.srcElement, "ClassName", "Coolbutton");
for (nummenu=1;nummenu<=mnumberofsub;nummenu++) {
var thesub=document.all[' Msubmenudiv ' +nummenu]
if (!) ( menuid==thesub| | Menuid.style.tag>=thesub.style.tag)) {
Msubmenuhide (thesub);
Mnochange (document.all[' MP ' +nummenu]);
document.all["Mitem" +nummenu].style.color=mfontcolor;
}
}
if (item) document.all["Mitem" +item].style.color=mmenuovercolor;
if (misdown| | Item) {
Mtoin (Srcel);
}
else{
Mtoout (Srcel);
}
if (x==-1) mthestatus=eval ("Msub" +j). Items[i].statustxt;
if (j==-1) mthestatus=mmenus[x].items[i].statustxt;
if (mthestatus!= "") {
Musestatus=true;
Window.status=mthestatus;
}
Cleartimeout (Mpoptimer);
}
function Mmenuitem_out (hassub) {
Toel = Getreal (window.event.toElement, "ClassName", "Coolbutton");
Fromel = Getreal (window.event.fromElement, "ClassName", "Coolbutton");
if (Toel = = Fromel) return;
Srcel = Getreal (window.event.srcElement, "ClassName", "Coolbutton");
if (!hassub) Mnochange (srcel);
if (musestatus) window.status= "";
Mpopout ()
}
function Mmenuitem_down () {
Srcel = Getreal (window.event.srcElement, "ClassName", "Coolbutton");
Mtoin (Srcel)
Misdown=true;
}
function Mmenuitem_up () {
Srcel = Getreal (window.event.srcElement, "ClassName", "Coolbutton");
Mtoout (Srcel)
Misdown=false;
}
function Mexec3 (j,i) {
var cmd;
if (eval ("Msub" +j). items[i].target== "Blank") {
cmd = "window.open ('" +eval ("Msub" +j). items[i].command+ "");
}else{
cmd = eval ("Msub" +j). items[i].target+ ". Location=\" "+eval (" Msub "+j). items[i].command+" "";
}
eval (cmd);
}
function mexec2 (x) {
var cmd;
if (mmenus[x].target== "blank") {
cmd = "window.open ('" +mmenus[x].command+ ")";
}else{
cmd = mmenus[x].target+ ". Location=\" "+mmenus[x].command+" "";
}
eval (cmd);
}
function Mexec (x,i) {
var cmd;
if (mmenus[x].items[i].target== "blank") {
cmd = "window.open ('" +mmenus[x].items[i].command+ ")";
}else{
cmd = mmenus[x].items[i].target+ ". Location=\" "+mmenus[x].items[i].command+" "";
}
eval (cmd);
}
function Mbody_click () {

if (misshow) {
 srcel = getreal (window.event.srcElement, "ClassName", "Coolbutton");
 for (Var x=0; x<=mmenus.length;x++) {
  if (srcel.id== "Mmenu" +x)
  return
 }
 for (x=1;x<= mnumberofsub;x++) {
  if (srcel.id== "MP" +x)
  return;
 
 mallhide ();
}
}
Document.onclick=mbody_click;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.