Google Maps InfoWindow has horizontal scroll bar -


i have issue horizontal scroll bars appearing on infowindow popup when there lot of content inside. fine when there small amount of content doesn't go below height. seems calculate size before knowing content goes below height, doesn't factor scroll bar width in.

i have set width of containing div i'm passing 480px, getting inserted div 460px, hence scroll bar. i've tried width auto well. haven't managed find solution answers other similar questions i've read.

i have created jsfiddle show i'm talking about: http://jsfiddle.net/th7yt/1/

having vertical scroll bar acceptable, don't want horizontal one.

hopefully able me figure out how rid of it.

thanks.

for want see code here:

html

<div id="map-canvas"></div> 

css

#map-canvas {     width: 1017px;     height: 500px;     margin-top: 50px; } .branch-location {     width: 480px;     padding-top:10px;     margin-bottom: 20px; } .branch-location .block-title {     font-family: arial;     font-size: 15px;     font-weight: bold;     margin-bottom: 10px;     margin-left: 20px; } .branch-location .contact-info {     width: 270px;     font-size: 12px;     font-family: arial; } [class*="span"] {     float: left;     margin-left: 20px; } .branch-location .contact-info address {     font-size: 1em;     margin-bottom: 10px;     font-style: normal;     line-height: 1.667em; } .branch-location .contact-info address .country {     display: block; } .branch-location .entry-link {     display: block;     margin-bottom: 10px;     color: #007571;     text-decoration: none; } .branch-location .branch-note, .branch-location .branch-hours {     line-height: 1.667em; } .branch-location .branch-hours-heading {     display: block;     font-weight: bold;     margin-top: 8px;     margin-bottom: 10px; } .branch-location .contact-entries-block {     float: left;     line-height: 1.667em;     margin-left: 30px;     width: 160px;     font-family: arial;     font-size: 12px;     word-wrap: break-word; } .branch-location .contact-entries-block {     display: block;     color: #007571;     text-decoration: underline; } .numbers .tel-numbers {     display: block;     margin-left: 13px; } 

javascript

var lat = -37.7833; var lng = 144.9667; var coord = new google.maps.latlng(lat, lng); var infohtml = '<div class="row branch-location" itemscope itemtype="http://schema.org/organization">' +     '<h3 class="block-title" itemprop="name"></span>test branch</h3>' +     '<div class="span3 contact-info">' +     '<address itemprop="address" itemscope itemtype="http://schema.org/postaladdress">' +     '<span itemprop="streetaddress">' +     'address line1<br />' +     'address line2<br />' +     '</span>' +     '<span itemprop="addresslocality">suburb &nbsp</span> <span itemprop="addressregion">state &nbsp</span><span itemprop="postalcode">postcode</span><br />' +     '<span itemprop="addresscountry" class="country">australia</span></address>' +     '<a href="http://maps.google.com?daddr=-37.7833,144.9667"' +     'class="entry-link email-link" target="_blank">' +     '<span class="icon icon-right-small"></span>' +     'get directions' +     '</a>' +     '<span class="branch-note">lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque enim lorem, semper @ facilisis sit amet, convallis non massa. etiam in mattis justo. cras dictum rutrum elit, sed consequat eros facilisis adipiscing. suspendisse id tincidunt dolor. donec laoreet malesuada dolor, quis aliquam dolor eleifend pharetra. integer id ipsum non nibh dapibus consequat ut vitae erat. maecenas quis nisl odio, quis scelerisque mauris. nullam sit amet nibh tellus, eu tempus urna. quisque ut lectus sapien, commodo urna.</span><span class="branch-hours-heading">hours of operation:</span>' +     '<span class="branch-hours">8.30 5.30 pm</span>' +     '</div>' +     '<div class="contact-entries-block">' +     '<div class="numbers">' +     '<p itemprop="telephone">t 123456789<span class="tel-numbers">987654321</span></p>' +     '<p itemprop="faxnumber">f 123456789</p>' +     '</div>' +     '<a href="mailto:test@someemail.com" title="" itemprop="email">test@someemail.com</a>' +     '<a href="mailto:thisisalongemailtotestwrapping@someemail.com" title="" itemprop="email">thisisalongemailtotestwrapping@email.com</a>' +     '</div>' +     '</div>';  var mapoptions = {     center: coord,     zoom: 15,     maptypeid: google.maps.maptypeid.satellite };  var map = new google.maps.map(document.getelementbyid("map-canvas"), mapoptions);  var marker = new google.maps.marker({     position: coord,     map: map });  var infowindow = new google.maps.infowindow({     content: infohtml,     position: coord });  google.maps.event.addlistener(marker, 'click', function () {     infowindow.open(map, marker); });  // close infowindow when user clicks anywhere on map google.maps.event.addlistener(map, 'click', function () {     infowindow.open(null, null); }); 

on ubuntu chrome, have no horizontal scrollbar untill scroll down end of text inside infowindow. @ point, horizontal scrollbar appears.

just add

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

inside css rid of it


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -