$(document).ready(function() { // R = Raphael("stateMap", 700, 475); tooltip = new Tooltip(); for ( var stateCode in usMap) { var sObj = usMap[stateCode]; Rstates[stateCode] = R.path(sObj.path).attr(Rattr); if (!!sObj.properties) { Rstates[stateCode][0]._zoom = sObj.zoom; Rstates[stateCode][0]._title = sObj.title; Rstates[stateCode][0]._lat = sObj.lat; Rstates[stateCode][0]._lng = sObj.lng; Rstates[stateCode][0].style.fill = "#d3d3d3"; // init medium grey overlay Rstates[stateCode][0].style.cursor = "pointer"; Rstates[stateCode][0].onmouseover = function(event){ this.rel = this.style.fill; this.style.fill = "#68973a"; //fill with green tooltip.awake(this._title,event); }; Rstates[stateCode][0].onmousemove = function(event) { tooltip.move(event); }; Rstates[stateCode][0].onmouseout = function(){ this.style.fill = "#d3d3d3"; // mouse out color back to medium grey tooltip.sleep(); }; Rstates[stateCode][0].onmousedown = function() { selectedState = this; map.setCenter(new google.maps.LatLng(this._lat,this._lng)); map.setZoom(this._zoom); $('#stateMap').fadeOut(); var n = $('<a>').attr({href:'#'}).html("United States").click(resetNationMap); var s = $('<a>').attr({href:'#'}).html(this._title).click(resetStateMap); $('#viewStateMap').html(n).append(' » ').append(s).fadeIn(); } } } });
this.style.fill = "#68973a";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)