2017-06-29 131 views
0

在这里我有一个情况,我想使我的mapwell一个fixed大小。如何使井固定尺寸引导

这里是一个的jsfiddlehttps://jsfiddle.net/x4gM4/36/(请滚动要注意什么,我试图)

我已经尝试一下你们在的jsfiddle看到请帮助我,使我的map一个fixed sized

这里是我的主要的div

<div class="row"> <!-- start of row --> 
    <div class="col-sm-6"> 
     <div class="well"> 4 images goes here </div> 
    </div> 

<!-- google map goes here, whom i want to be fixed --> 
    <div class="col-sm-6"> 
     <div class="well"> 
      google Map 
     </div> 
    </div> 
</div> <!-- end of one row --> 

问题:我想google mapwell是固定的反对scrollingimages

请的jsfiddle大小按下面的图片

enter image description here

请帮我在此先感谢!

+0

'position:fixed' –

回答

1

我相信这是你需要的。

div.fixed-map { 
    position: relative; 
} 
div.fixed-map > div.well { 
    position: fixed; 
} 

Updated fiddle

0

你需要position: fixed

#map-canvas { 
    height: 100%; 
    width: 300px; 
    background-color: #CCC; 
    position: fixed; 
    right: 0; 
    top: 0; 
} 

但是,你需要相对权和顶部位置设置为整个窗口,不仅父DIV。

+0

您的代码无效。 – silentw