No matter how strict or loose you code, this is wrong:
Code:
var myMenu; = new SDMenu("my_menu");
Further, those don't look like two separate onload functions to me. They look like one onload function followed by another onload function that attempts to incorporate the first one with a second one. A potential* error that jumps out at me is that in the first scenario:
var myMenu;
is declared in the global scope. But, in the second scenario, it is within the local scope of the onload function. I'd try this:
Code:
<script type="text/javascript">
var myMenu;
window.onload = function()
{
settings = {
bl: { radius: 6 },
br: { radius: 6 },
tl: { radius: 6 },
tr: { radius: 6 },
antiAlias: true,
autoPad: false
}
var div1Obj = document.getElementById("header");
var div2Obj = document.getElementById("header2index");
var cornersObj = new curvyCorners(settings, div1Obj);
cornersObj.applyCornersToAll();
var cornersObj = new curvyCorners(settings, div2Obj);
cornersObj.applyCornersToAll();
myMenu = new SDMenu("my_menu");
myMenu.init();
}
</script>
There could be other problems.
*I say potential because var myMenu may not need to be in the global scope but, then - why was it it placed there in the first example?
Bookmarks