javascript - Js:Calling a function on click -
I use maplace.js, a Google Maps JavaScript plugin for jQuery. The plugin has a function that will display the marker on the map.
You can do this:
& lt; One class = "openmap" href = "#" & gt; Link & lt; / A & gt;
and JS:
$ ('. Openmap'). ('Click', function (e) {e.prevetDefault (); Maplace.prototype.ViewOnMap = function (index) {// View all, then (index === this.view_all_key) {this.o .beforeViewAll (); this.current_index = index, if (this.o.locations.length & gt; 0 & amp; amp; amp; it.o.generate_controls & amp; this.current_control & amp; This.current_control.activateCurrent) {this.current_control.activateCurrent.apply (this, [index]);} this.oMap.fitBounds (this.oBounds); this.CloseInfoWindow (); this.o.afterViewAll (); // Specific place} else {index = parseInt (index, 10); if (typeof (index - 0) === 'number' & amp; amp; index> gt; 0 and index & lt; = this.ln) {Try {google.maps.event.trigger (this.marker [Index-1], 'click');} catch (mistake) {This.debug ('ViewOnMap :: trigger', err.stack);}}} return it;};});
Comments
Post a Comment