Resolution | Client I made a Web navigation pull-down menu, with firework can be quickly generated, only to copy the code to the page on it, but the user side of the different resolution caused the drop down menu location of the move, how to 800 and 1024 of the menu to maintain the correct display, Modify a JS file in a function can be, y only need not change, only change the x coordinate variable can
function Mm_showmenu (menu, x, y, child, imgname) {
if (!window.mmwrotemenu) return;
mm_cleartimeout ();
if (menu) {
var obj = find (imgname) | | Document.images[imgname] | | Document.links[imgname] | | Document.anchors[imgname];
if (window.screen.width==800 && window.screen.height==600)//To 800*600 resolution settings
{
x = Movexbyslicepos (x-100, obj);
y = moveybyslicepos (y, obj);
}
if (window.screen.width==1024 && window.screen.height==768)//1024 Resolution settings
{
x = Movexbyslicepos (x, obj);
y = moveybyslicepos (y, obj);
}
}
if (document.layers) {
if (menu) {
var L = Menu.menulayer | | Menu
l.top = L.left = 1;
Hideactivemenus ();
if (this.visibility) L = this;
window. Activemenu = l;
} else {
var L = child;
}
if (!l) return;
for (var i=0 i<l.layers.length; i++) {
if (!l.layers[i].ishilite) l.layers[i].visibility = "Inherit";
if (l.layers[i].document.layers.length > 0) mm_showmenu (null, "relative", "relative", l.layers[i));
}
if (l.parentlayer) {
if (x!= "relative") L.parentlayer.left = x | | Window.pagex | | 0;
if (l.parentlayer.left + l.clip.width > Window.innerwidth) l.parentlayer.left-= (L.parentlayer.left + l.clip.wid Th-window.innerwidth);
if (y!= "relative") l.parentlayer.top = y | | Window.pagey | | 0;
if (l.parentlayer.iscontainer) {
L.menu.xoffset = Window.pagexoffset;
l.menu.yoffset = Window.pageyoffset;
l.parentlayer.clip.width = window. ActiveMenu.clip.width +2;
l.parentlayer.clip.height = window. ActiveMenu.clip.height +2;
if (l.parentlayer.menucontainerbgcolor && l.menu.menubgopaque) L.parentlayer.document.bgcolor = L.parentlayer.menucontainerbgcolor;
}
}
l.visibility = "Inherit";
if (l.menu) l.menu.container.visibility = "Inherit";
} else if (Find ("MenuItem0")) {
var l = Menu.menulayer | | Menu
Hideactivemenus ();
if (typeof (L) = = "string") L = Find (l);
window. Activemenu = l;
var s = l.style;
s.visibility = "Inherit";
if (x!= "relative") {
s.pixelleft = x | | | (Window.pagex + document.body.scrollLeft) | | 0;
S.left = s.pixelleft + ' px ';
}
if (y!= "relative") {
s.pixeltop = y | | (Window.pagey + document.body.scrollTop) | | 0;
s.top = s.pixeltop + ' px ';
}
l.menu.xoffset = Document.body.scrollLeft;
l.menu.yoffset = Document.body.scrollTop;
}
if (menu) window.activemenus[window.activemenus.length] = l;
mm_cleartimeout ();
}