javascript - 删除信息窗口的右边距和底部边距

标签 javascript html css google-maps infowindow

我正在使用 google InfoWindow。

几乎一切都是完美的。我只是在 window 上遗漏了一些东西。

我总是有一个右边和底部的空白。

我不太介意底部的那个,但我想去掉右边的那个。

知道怎么做吗?

example

编辑,这里是代码:

<div class="gm-style-iw" style="position: absolute; left: 12px; top: 9px; overflow: auto; width: 352px; height: 290px;">
  <div class="" style="overflow: auto;">
    <div class="infoBox">
      <div style="max-width: 352px; padding: 0px;">
        <div id="info-map-element"> 
          <div class="street"> 
            <img src="http://maps.googleapis.com/maps/api/streetview?size=360x190&amp;location=37.7831059,-122.4446528&amp;fov=90&amp;heading=235&amp;pitch=10&amp;sensor=false" alt=""> 
            <div class="shadow"></div>
            <div class="title"> Customer History<br> 123 Foo Av, San Francisco, CA 12345</div>       
          </div>
          <div class="wrap clearfix"> 
            <div class="item  clearfix">
              <small>2013-09-11</small>
              <p>This is the a test of customer history purchases.</p>
                <div class="row clearfix">
                  <div class="col-lg-5"> Cost Estimate <span>$11000</span></div>
                <div class="col-lg-7"> Purchase No. <span>123456789</span></div>
            </div> 
            <div class="row clearfix">
              <div class="col-lg-12"> Sell by <a href="">My Online seller dot com</a></div>
            </div>
          </div>
          <div class="row clearfix"></div>
        </div>
      </div>
    </div>
  </div>
</div>


#map_newsfeed .gm-style-iw {
    width: 352px!important;
    height: auto!important;
    left: 0!important;
    font-size: 15px!important;
    font-weight: normal!important;
    top: 0!important;
    overflow: hidden!important;
    border-radius: 3px;
}
#map_newsfeed .gm-style-iw > div {
    overflow: hidden!important;
}.gm-style .gm-style-iw, .gm-style .gm-style-iw a, .gm-style .gm-style-iw span, .gm-style .gm-style-iw label, .gm-style .gm-style-iw div {
    font-size: 13px;
    font-weight: normal;
}#info-map-element .row > div {
    font-size: inherit;
    font-weight: inherit;
}
#info-map-element .shadow {
    width: 100%;
    height: 100%;
    bottom: 0;
    -webkit-box-shadow: 0 -35px 75px rgba(0,0,0,0.95) inset;
    box-shadow: 0 -35px 75px rgba(0,0,0,0.95) inset;
    position: absolute;
    font-style: normal;
    font-weight: normal;
    z-index: 1;
}
#map .gm-style {
    font-family: inherit;
}#info-map-element .pagination {
    margin: 10px 0 0;
}
.infoBox > img {
    position: absolute;
    top: 0px;
    right: 25px;
    display: block;
    z-index: 3;
}
#info-map-element .pointer {
    width:23px;
    height:19px;
    top: 99%;
    left: 41%;
    position:absolute;
    display:block;
    background: transparent url('http://d3flf7kkefqaeh.cloudfront.net/_assets/3/pointer_down.png'); 
}#info-map-element .wrap {
    padding: 0;
}
#info-map-element .wrap .item:nth-child(even) {
    background: #ececec;
}
#info-map-element .wrap .item {
    padding: 10px;
}#legend strong {
    float: left;
    margin: 0 10px 0 0;
    display: block;
}

EDTI#2: 所以我可以用 Jquery 以我想要的方式更改 dom。这 3 行有效”

$(".gm-style-iw").next("div").css("right", '52px');
$(".gm-style-iw").prev("div").children().last().css("width", '351px');
$($(".gm-style-iw").prev("div").children()[1]).css("width", '351px');

但由于某些原因只有第一行被执行。

最佳答案

填充是由应用于 .gm-style-iw-d div 的滚动引起的,这会删除它但要小心并确保所有内容都适合最大宽度和高度信息窗口的原因,否则它将被隐藏。

.gm-style-iw-d {
    overflow: hidden !important;
}

关于javascript - 删除信息窗口的右边距和底部边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21542870/

相关文章:

javascript - HTML - Fancybox - 在图像缩略图下方添加文本

javascript - SVG 的 Markdown 模拟

java - 如何安排自动打印作业?

html - 如何在响应式布局中垂直对齐图像而无需绝对定位

Android HTML 类似于 TextView 中的 Textwrapping

css - 为移动设备显示不同的 DIV

javascript - JS - 检测 UIwebView

html - 如何用css格式化输入框中的文本

html - 你能帮我修一下 table 吗?

css - 当 child 的高度大于鹦鹉高度时,通过保持比例缩放 child (里面有图像)