0

我的网络应用程序中有我的谷歌地图的这个信息框,我想在点击信息框上的链接时生成一个弹出框。我怎样才能做到这一点?

4

2 回答 2

0

信息窗口可以包含 HTML。只需在您的信息窗口内容中编写链接,但您通常会使用 HTML 和/或 javascript 弹出一个窗口。

<a href="page2.html" onclick="window.open('page2.html'); return false;" target="_blank">open popup</a>
于 2012-05-14T14:37:28.910 回答
0

通常弹出框用于 HTML/JavaScript。请参阅弹出框和测试浏览器兼容的完整代码。

<style>
.poppup_overlay{
    display: none;
    position:fixed;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index:10001;
    -moz-opacity: 0.7;
    opacity:.70;
    filter: alpha(opacity=70);
}

.poppup_content {
    display: none;
    position: absolute;
    padding:5px;
    border: 0px solid orange;
    background-color: white;
    z-index:10002;
    overflow: auto;
    width:300px;
    left:44%;
    margin-top: -250px;
    margin-left: -250px;
    top: 40%;
}

.poppup-image {
    display: none;
    position: absolute;
    padding:5px;
    border: 0px solid orange;
    background-color: white;
    z-index:10002;
    overflow: auto;
    width:300px;
    left:50%;
    margin-top: -250px;
    margin-left: -180px;
    top: 40%;
}

</style>


<body>

<!------popup google map---------> 
<a class="" href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block';document.getElementById('mapframe').src='embed URL here';">TEXT</a>
<div id="light" class="poppup_content"> <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"><img src="images/close.gif" border="0" align="right" /> </a><br />
  <br />
  <iframe id="mapframe" width="300" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" ></iframe>
  <br />
  <small><a href="embed URL here" style="color:#0000FF;text-align:left">TEXT</a></small></div>
<div id="fade" class="poppup_overlay">&nbsp;</div>


<!------popup image---------> 
<a class="" href = "javascript:void(0)" onclick = "document.getElementById('light1').style.display='block';document.getElementById('fade').style.display='block';document.getElementById('layout').src='images here';">Site Layout</a>
<div id="light1" class="poppup-image"> <a href = "javascript:void(0)" onclick = "document.getElementById('light1').style.display='none';document.getElementById('fade').style.display='none'"><img src="images/close.gif" border="0" align="right" /> </a><br />
  <br />
  <img src="images here" align="right" /> </div>
<div id="fade" class="poppup_overlay">&nbsp;</div>

</body>
于 2013-03-06T07:31:10.053 回答