Urgent help with hover-onclick!

Discussion created by redwonnie on Mar 24, 2011
Latest reply on May 12, 2011 by WarrenMedernach
Hi, I'm new & I need help as I'm stuck with the codes.

Basically, what I'm trying to do is to implement hover & onclick functions on an icon. When I mouse over an icon, the infoWindow will appear or user can choose to onclick on the infoWindow.

Here's the sample codes that I tried with:
    <script type="text/javascript">
        var map=null;
        var topoMap=null; 
        var levelNumber=1; 
        var centerPoint="32173.834393929,29296.8452311538"; 
        var OneMap = new GetOneMap('map','SM',{level:levelNumber,center:centerPoint}); 
        function initialize() { 
            //handle map object here
            if( map ==null  )
                LogError("map not initialized");return;
            //dojo.connect(map, "onLoad", PlaceLabel); 

        function PlaceLabel(evt) {
        var strImage,symbol,pt,graphic,stX,stY,infoTemplate,json,g,cont,cont1,tit,lin;
        var icounter = 0;
stX             =   "23319.3347409758";
stY             =   "28825.7191286444";
tit = "TRY OUT";
cont = "abc";
lin= "" 
pt= new esri.geometry.Point(stX,stY,map.spatialReference); 
cont1 = "Description:"+cont+ "<br/>Detail:"+lin; 
strImage = "C:/Users/L33508/Desktop/images/fish.jpg";
symbol = new esri.symbol.PictureMarkerSymbol(strImage, 25,25);
json = {title:tit,content:cont1 };
infoTemplate = new esri.InfoTemplate(json);
graphic = new esri.Graphic(pt,symbol); 
dojo.connect(graphic, "onClick", function(evt){
g = evt.graphic;

Here's the sample OneMap codes which I want to implement the above codes into:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>OneMap-Add Map</title>
   <script type='text/JavaScript' src=''></script>
    <script language="JavaScript" type="text/JavaScript">
//    //add map with default settings
//    var OneMap = new GetOneMap('divMain','SM');
//    //add map with defined centerPoint
//    var centerPoint="28968.103,33560.969"
//    var OneMap = new GetOneMap('divMain','SM',{center:centerPoint});

//    //add map with defined zoom level
//    var levelNumber=8;
//    var OneMap = new GetOneMap('divMain','SM',{level:levelNumber});

//    //add map with layer
//    var myLayerService = "";
//    var myLayer = new esri.layers.ArcGISDynamicMapServiceLayer(myLayerService);
//    var centerPoint="28968.103,33560.969"
//    var levelNumber=8;
//    var OneMap = new GetOneMap('divMain','SM',{level:levelNumber,layer:myLayer,center:centerPoint}); 
    //add map with defined center location and zoom level
    var centerPoint="28968.103,33560.969"
    var levelNumber=8;
    var OneMap = new GetOneMap('divMain','SM',{level:levelNumber,center:centerPoint});  

function addMap() {
    var myLayerService = "";
    var myLayer = new esri.layers.ArcGISDynamicMapServiceLayer(myLayerService);;
function GetCurrentLevel() {
  alert ("Current Level:" +

  <body class="tundra">
  <div id="divMain" style='width:450px;height:450px;'></div></td>
  <td>Map navigation using mouse:
      <li>Drag to pan</li>
      <li>Mouse Scroll Forward to zoom in</li>
      <li>Mouse Scroll Backward to zoom out</li>
      <li>Use Arrow keys to pan</li>
      <li>Double Click to Center and Zoom in</li>
  </td>  </tr></table>
  <input id="Button1" type="button" style="width:150px" value="Add Map" onclick="addMap()" />
<input id="Button3" type="button" style="width:150px" value="Current Map Level" onclick="GetCurrentLevel()" />



I've also attached a sample screenshot of a onclick version. However, I want both the onclick & hover.

Please help, thanks!