Forum Moderators: open
Here is the code.
<script type="text/javascript">
//<![CDATA[
window.onload = function() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(37.0588, -93.3045), 16);
// Our info window content
var infoTabs = [new GInfoWindowTab("HERE", "<b> GRAYSTONE</b>")];
// Place a marker in the center of the map and open the info window automatically
var marker = new GMarker(map.getCenter());
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowTabsHtml(infoTabs);
});
map.addOverlay(marker);
marker.openInfoWindowTabsHtml(infoTabs);
}
if(!NiftyCheck())
return;
Rounded("div#nifty","all","#999999","transparent","smooth");
Rounded("div#nifty2","all","#999999","transparent","smooth");
Rounded("div#nifty3","all","#999999","transparent","smooth");
Rounded("div#niftybody","all","#999999","transparent","smooth");
Rounded("div#nifty4","all","#999999","transparent","smooth");
}
//]]>
</script>
I runs as long as it is on the map page, but if it is open on any other page, my NiftyCheck part of the script doesn't run. I am sure I have a bracket in the wrong place or something else totaly obvious. But I am pulling my hair out trying to find it. Help please?
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload!= 'function') {
window.onload = func;
}
else {
window.onload = function() {
oldonload();
func();
}
}
}
originally written by Simon Wilson
[simonwillison.net ]
it rox...