简体   繁体   中英

Trigger event (image fadein) for external div on polygon mouseover with Google Maps API V3

Been looking a while for a solution and not sure exactly how to execute this... I'm trying to have a polygon trigger an event outside of the map area. Basically what I'm trying to figure out is how to have an image in some div fade in when the polygon is on mouseover, and fade out when at mouseout.

I tried looking at this for help but not sure exactly how to make it work that way. http://gmaps-samples-v3.googlecode.com/svn/trunk/map_events/map_events.html

Without jQuery, I don't think I could have helped you. See this page:

http://jsfiddle.net/CUfZS/3/

In the javascript:

google.maps.event.addListener(polygon, 'mouseover', function(event) {
          $("#myImage").fadeIn("slow");
});

In the body:

<img id="myImage" src="https://chart.googleapis.com/chart?chst=d_bubble_icon_text_small&chld=ski|bb|Wheeee!|FFFFFF|000000" />

The image starts hidden:

 #myImage {display: none}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM