I have a portion of script that I am trying to modify to automatically adjust my menu dynamic positioning. I have tried everything I can think of and have not had success. Your help is greatly appreciated.
Thank you,
DanOoo
These lines of (old code) I need to adjusted to work with my (new code)
--------------------------
--------------------------
Thank you,
DanOoo
These lines of (old code) I need to adjusted to work with my (new code)
--------------------------
Code:
//****old code****
function redo()
{
var offset = -293
var newLeft = getWindowWidth() / 2 + offset;
menu.container.style ? menu.container.style.left = newLeft + "px" : menu.container.left = newLeft;
}
function getWindowWidth()
{
return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
}
Code:
//****new code****
document.write('<style type="text/css">' + ypSlideOutMenu.styleMod + '</style>');
for (var i = 0; i < menus.length; i++) {
menus[i].onactivate = new Function("document.getElementById('act" + i + "').className='active'");
menus[i].ondeactivate = new Function("document.getElementById('act" + i + "').className='';");
}