page.winW=function()
{ with (this) return Math.max(minW, MS?win.document[db].clientWidth:win.innerWidth) };
page.winH=function()
{ with (this) return Math.max(minH, MS?win.document[db].clientHeight:win.innerHeight) };
page.scrollX=function()
{ with (this) return MS?win.document[db].scrollLeft:win.pageXOffset };
page.scrollY=function()
{ with (this) return MS?win.document[db].scrollTop:win.pageYOffset };
function repositionMenus(mN) { with (this)
{
var menu = this.menus[mN].lyr;
// Showing before measuring corrects MSIE bug.
menu.sty.display = ‘block’;
// Reset to and/or store original margins.
if (!menu._jsm_origML) menu.
menu.ref.currentStyle.marginLeft : (menu.sty.marginLeft || ‘auto’);
if (!menu._jsm_origMT) menu.
menu.ref.currentStyle.marginTop : (menu.sty.marginTop || ‘auto’);
menu.sty.marginLeft = menu._jsm_origML;
menu.sty.marginTop = menu.
// Calculate absolute position within document.
var menuX = 0, menuY = 0,
menuW = menu.ref.offsetWidth, menuH = menu.ref.offsetHeight,
vpL = page.scrollX(), vpR = vpL + page.winW() – 16,
vpT = page.scrollY(), vpB = vpT + page.winH() – 16;
var mp = page.elmPos(menu.ref);
// Compare position to viewport, reposition accordingly.
var mgL = 0, mgT = 0;
if (mp.x + menuW > vpR)
{
// mgL = -menuW ;
if(this.menus[mN].par.lyr.ref.offsetWidth > menuW);
{
mgL = – menuW-27;
}
}
if (mp.x + mgL < vpL) mgL = vpL – mp.x;
if (mp.y + menuH > vp? mgT = vpB – mp.y – menuH ;
if (mp.y + mgT < vpT) mgT = vpT – mp.y;
if (mgL) menu.sty.marginLeft = mgL + ‘px’;
if (mgT) menu.sty.marginTop = mgT + ‘px’;
}};
// Set this to process menu show events for a given object.
//addEvent(listMenu, ‘show’, repositionMenus, true);
here is the javascript function for the menu
th eproblem if the extreme left most menu crosses the viewport the corresponding submenus should displat at the left side.plz say whether it is possible or not f possible plz send me the function.
THANKS,
Lavanya.