2014-02-28 57 views
0

有沒有這樣做的插件或方法來做到這一點?把一個div放在googlemap之上?

看,我有這個site,如果你滾動到底部,你會看到一個地圖。我想要做的就是在地圖上放置一個小盒子,就像一個包含聯繫信息的疊加層。

編輯:盒子將在水汪汪的部分頂部。 :)

回答

0

像這樣的東西(不使用內聯樣式明顯):

<div id="googleMapContainer" style="height: 400px; position: relative;"> 
    <div id="overlay" style="height: 300px; width: 25%; max-width: 340px; position: absolute; top: 50px; left: 0px; background-color: rgba(0, 0, 0, 0.7); box-sizing: border-box; padding: 20px; color: #ffffff;"> 
     <p><a style="color: #f1f1f1;">Here's a link in your overlay</a></p> 
    </div> 
    <div class="google_map" id="map_canvas" style="width: 100%; height: 400px; margin: 0;"></div> 
</div> 
1

你可以試試這個:

<div class="section" id="contact"> 
    <div style="width:100px; height:200px; background:#ccc;z-index:999999;position:absolute;">test</div> 
</div> 

添加一個div您的單元DIV如我上面的代碼後,... (例如:添加 - 頂部:「你需要」;左:「你需要」;)

祝你好運