Javascript 谷歌地图标记-链接到div类

Javascript 谷歌地图标记-链接到div类,javascript,google-maps,url,google-maps-api-3,marker,Javascript,Google Maps,Url,Google Maps Api 3,Marker,我需要在谷歌地图标记上添加一个链接。它与外部URL(.)一起工作,但不与div链接一起工作。 当我们点击一个标记时,我希望它打开一个带有模态效果的div 以下是带有要打开的div的HTML: <div class="modal faune"> <div class="barre_gallery"> <img alt="" class="close" onclick="$.f

我需要在谷歌地图标记上添加一个链接。它与外部URL(.)一起工作,但不与div链接一起工作。 当我们点击一个标记时,我希望它打开一个带有模态效果的div

以下是带有要打开的div的HTML:

<div class="modal faune">     
  <div class="barre_gallery">                                
        <img alt="" class="close" onclick="$.fn.custombox('close');" src="img_content/croix.png" width="30"/>
        <h1>Test</h1>    
   </div>    

    <p>Paragraphe test</p>

</div> 

你有什么想法吗?谢谢

window.location.href=$(“.modal.faune”)
不起作用。您需要有一些逻辑来确定它是外部href还是div链接(例如,每个标记上的布尔属性)


从标记事件侦听器调用模态如何

google.maps.event.addListener(marker1, 'click', function() {

    Custombox.open({
        target: '.faune',
        effect: 'fadein'
    });
    e.preventDefault();

});   
编辑:了解您使用的模态也可以帮助您解决问题


假设这是您正在使用的模式。

谢谢!我正在使用custombox,但它是jquery。我没有任何脚本要管理。它是这样工作的:这是模态框Yeeees,它工作了!!:D非常感谢你!祝你周末愉快。:)谢谢你的回答。这里我只需要使用div链接。
if (external link)
   window.location.href = this.url;
else 
   this.url.trigger('click');
google.maps.event.addListener(marker1, 'click', function() {

    Custombox.open({
        target: '.faune',
        effect: 'fadein'
    });
    e.preventDefault();

});