I’m having another small problem with a drop-down menu (one problem has been resolved).
I have a script on a page for a Google Map API.
Now, if I add a script to add a menu to the page, it doesn’t work. As far as I knew, all you had to do was to put a semicolon between functions called, but that doesn’t work, and I have no idea what else could be wrong.
[code]
<script type=”text/javascript”>
//google map script
function initialize() {
if (GBrowserIsCompatible()) {
var map2 = new GMap2(document.getElementById(“hfxmap”), { size: new GSize(470,300) });
var marker2 = new GMarker(new GLatLng(44.647284,-63.571959));
map2.addControl(new GLargeMapControl());
map2.addControl(new GMapTypeControl());
map2.setCenter(new GLatLng(44.647284,-63.571959 ), 16);
map2.addOverlay(marker2);
}
}
//menu script
//window.onload=function(){show(‘s’+document.body.id);};
//the above was originally where the menu’s onload function was, but with two functions now, I have no idea what to do.
function show(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById(‘smenu’+i)) {document.getElementById(‘smenu’+i).style.display=’none’;}
}
if (d) {d.style.display=’block’;
}
}
What can I do to call both functions to work properly?