Help with maps plugin CSS styling

Hi! I have a plugin on my website that shows different locations for our store. I’ve been having a set of issues trying to position, style it and adapt it to the website.

See the problems HERE.

  • The first problem is getting the plugin to position itself directly under the title and next to the text, on the right of the page. For some reason, it’s pushed down under the text.
  • The second issue I’m having is rendering some space under the maps, like a bottom margin that separates it from the footer. I use a Jquery function that determines the height of my content after it has loaded it. For some reason, it always renders only a portion of the height of the maps, and then the footer covers the rest. I tried adding a bottom margin to the css but it renders differently in different browsers (even though I’m using a css reset). What am I missing?
  • The third issue I’m having has to do with styling the dialogs and text inside of the map. The plugin uses the foundation stylesheet , but I’m not sure what settings I need to change. For example, when I click on Anaheim, I would like the dialog and the text to be a little bigger and not have a scrollbar.

Here’s the HTML markup:



<div id="content">
<div id="page-title">CONTACT US.</div>
<p id="content-text2">We have 9 full-service locations to serve your needs. If you have any questions or need assistance call one of our offices and they'll be happy to assist you. <br /> <br /><br />Would you like us to contact you? Need more information? Click <a href="#">HERE</a><br /></p>

<div id="gmap-tabs" class="gmap"></div>

<!--Script that load the map plugin-->
<script>
  new Maplace({
    locations: [
    {
      lat: 33.8583,
      lon: -117.8678,
      title: 'Anaheim',
      html: [
      '<h3>Anaheim</h3>',
      '<p>1361 N RedGum St, Anaheim CA 92806<br>(714) 630-5954</p>'
      ].join(''),
      zoom: 8
    },
    {
      lat: 34.2358,
      lon: -118.5739,
      title: 'Chatsworth',
      html: [
      '<h3>Chatsworth</h3>',
      '<p>20233 Corisco St, Chatsworth CA 91311<br>(818) 998-3001</p>'
      ].join(''),
      zoom: 8
    },
    {
      lat: 32.8142,
      lon: -117.1247,
      title: 'San Diego',
      html: [
      '<h3>San Diego</h3>',
      '<p>4000 Ruffin Road Suite K, San Diego CA 92123<br>(858) 292-1622</p>'
      ].join(''),
      zoom: 8
    }
    ,
    {
      lat: 34.9137,
      lon: -120.4632,
      title: 'Santa Maria',
      html: [
      '<h3>Santa Maria</h3>',
      '<p>1459 W. Fairway Dr., Santa Maria CA 93455<br>(805) 922-4445</p>'
      ].join(''),
      zoom: 8
    }
    ,
    {
      lat: 34.5011,
      lon: -117.3279,
      title: 'Victorville',
      html: [
      '<h3>Victorville</h3>',
      '<p>15400-B Tamarack Road, Victorville CA 92392<br>(760) 243-5666</p>'
      ].join(''),
      zoom: 8
    }
    ,
    {
      lat: 36.1605,
      lon: -115.1050,
      title: 'Las Vegas',
      html: [
      '<h3>Las Vegas</h3>',
      '<p>3101 Builders Ave., Las Vegas, NV 89101<br>(702) 452-2440</p>'
      ].join(''),
      zoom: 8
    }
    ,
    {
      lat: 33.1677,
      lon: -117.2202,
      title: 'Vista',
      html: [
      '<h3>Vista</h3>',
      '<p>2055 Thibodo Rd, Vista CA 92081<br>(760) 599-0791</p>'
      ].join(''),
      zoom: 8
    }
    ,
    {
      lat: 33.6224,
      lon: -117.7194,
      title: 'Laguna Hills',
      html: [
      '<h3>Laguna Hills</h3>',
      '<p>23561 Ridge Route Suite P, Laguna Hills CA 92653<br>(949) 699-3308</p>'
      ].join(''),
      zoom: 8
    }
    ,
    {
      lat: 34.4245,
      lon: -118.4998,
      title: 'Santa Clarita',
      html: [
      '<h3>Santa Clarita</h3>',
      '<p>26846 Oak Ave Unit R, Santa Clarita CA 91315<br>(661) 424-9396</p>'
      ].join(''),
      zoom: 8
    }
    ],
    map_div: '#gmap-tabs',
    controls_type: 'list',
    controls_title: 'Choose a location:'
  }).Load();

</script>

</div>

And here’s the CSS for the map:

<style>
    .gmap {
	float: right;
        height: 400px;
        width: 60%;
        border: 5px solid #ddd;
        font-size: 100%;
	margin-right:35px;	
	z-index:10;
		
    }
    </style>

As you can tell, I’m a CSS newbie, so bare with me. Any help would be appreciated. Thank you!

Hello Melitica ,

  1. First add float:left to your css in #content-text2
    #content-text2 {
    color: #000;
    font-size: 13px;
    padding-left: 35px;
    text-align: left;
    line-height: normal;
    padding-top: 16px;
    width: 305px;
    float: left;
    }

  2. You can try with setting margin-bottom of container ID. But I hope that will not work in your case as other css have many unwanted code. Thought I think you can try.

  3. Try to find something “gm-style-iw” in you js code and make the height auto and delete the overflow:auto code.

Let me know if these will help you anyway. Cheers.

Hi,

  1. As mentioned above floating context-text2 with the correct width will allow both elements to sit side by side. If the map was first in source then the text would have wrapped normally anyway.

  2. Your footer is position:fixed which means it will always overlap anything on the page that is in the way (just like it does on all your other pages if the window is small enough). It will always sit on the bottom of the viewport and margins on other elements will have no effect on it whatsoever. A bottom margin (in some browsers) may react to the bottom of the viewport but you would be better off using padding-bottom to your #contentarea to clear the footer height more robustly but you must first clear/contain your floats.



#contentarea:after{
content:" ";
clear:both;
display:block;
height:0;
}
#contentarea{padding-bottom:50px}

I’m not keen on the fact that you removed my horizontal scrollbar and fiddled with the viewports vertical scrollbar as your fixed positioned element now sits over the controls for the vertical scrollbar. It’s usually best to avoid touching the html and body overflow properties at all.

Hi! Thank you so much for checking out my post. Here are the results:

  • > First add float:left to your css in #content-text2


    This solved my first problem easily. I can’t believe I missed that one.

  • My third issue is still not fixed. I tried to look for
    > gm-style-iw
    in my js code but I couldn’t find anything with that tag. Here’s the code. Is there something else I could change to modify the dialog box?


    ```

    /**
  • Maplace.js 0.1.2c
  • Copyright (c) 2013 Daniele Moraschi
  • Licensed under the MIT license
  • For all details and documentation:
  • http://maplacejs.com
  • /
    (function (f, s, d, undefined) {
    ‘use strict’;
    var q, n, p;
    q = {
    activateCurrent: function (c) {
    this.html_element.find(“select”).val(c)
    },
    getHtml: function () {
    var c = this,
    a = “”,
    b;
    if (1 < this.ln) {
    a += ‘”).bind(“change”, function () {
    c.ViewOnMap(this.value)
    })
    }(b =
    this.o.controls_title) && (b = f(‘
    ’).css(this.o.controls_applycss ? {
    fontWeight: “bold”,
    fontSize: this.o.controls_on_map ? “12px” : “inherit”,
    padding: “3px 10px 5px 0”
    } : {}).append(this.o.controls_title));
    return this.html_element = f(‘
    ’).append(b).append(a)
    }
    };
    n = {
    html_a: function (c, a, b) {
    var e = this;
    a = a || c + 1;
    b = b || this.o.locations[c].title;
    c = f(‘’ + (b || “#” + (c + 1)) + “”);
    c.css(this.o.controls_applycss ? {
    color: “#666”,
    display: “block”,
    padding: “5px”,
    fontSize: this.o.controls_on_map ? “12px” : “inherit”,
    textDecoration: “none”
    } : {});
    c.on(“click”, function (a) {
    a.preventDefault();
    a = f(this).attr(“data-load”);
    e.ViewOnMap(a)
    });
    return c
    },
    activateCurrent: function (c) {
    this.html_element.find(“li”).removeClass(“active”);
    this.html_element.find(“#ullist_a_” + c).parent().addClass(“active”)
    },
    getHtml: function () {
    var c = f(“
      ”).css(this.o.controls_applycss ? {
      margin: 0,
      padding: 0,
      listStyleType: “none”
      } : {}),
      a;
      this.ShowOnMenu(this.view_all_key) && c.append(f(“
    • ”).append(n.html_a.call(this, !1, this.view_all_key, this.o.view_all_text)));
      for (a = 0; a < this.ln; a++) this.ShowOnMenu(a) && c.append(f(“
    • ”).append(n.html_a.call(this, a)));
      (a = this.o.controls_title) && (a = f(‘
      ’).css(this.o.controls_applycss ? {
      fontWeight: “bold”,
      padding: “3px 10px 5px 0”,
      fontSize: this.o.controls_on_map ? “12px” : “inherit”
      } : {}).append(this.o.controls_title));
      return this.html_element =
      f(‘
      ’).append(a).append(c)
      }
      };
      p = function () {
      function c(a) {
      this.VERSION = “0.1.2”;
      this.errors = ;
      this.loaded = !1;
      this.dev = !1;
      this.markers = ;
      this.oMap = !1;
      this.view_all_key = “all”;
      this.infowindow = null;
      this.ln = 0;
      this.oMap = !1;
      this.directionsDisplay = this.directionsService = this.Fusion = this.Polygon = this.Polyline = this.current_index = this.current_control = this.controls_wrapper = this.canvas_map = this.map_div = this.oBounds = null;
      this.o = {
      map_div: “#gmap”,
      controls_div: “#controls”,
      generate_controls: !0,
      controls_type: “dropdown”,
      controls_cssclass: “”,
      controls_title: “”,
      controls_on_map: !0,
      controls_applycss: !0,
      controls_position: d.maps.ControlPosition.RIGHT_TOP,
      type: “marker”,
      view_all: !0,
      view_all_text: “View All”,
      start: 0,
      locations: ,
      commons: {},
      map_options: {
      mapTypeId: d.maps.MapTypeId.ROADMAP,
      zoom: 1
      },
      stroke_options: {
      strokeColor: “#0000FF”,
      strokeOpacity: 0.8,
      strokeWeight: 2,
      fillColor: “#0000FF”,
      fillOpacity: 0.4
      },
      directions_options: {
      travelMode: d.maps.TravelMode.DRIVING,
      unitSystem: d.maps.UnitSystem.METRIC,
      optimizeWaypoints: !1,
      provideRouteAlternatives: !1,
      avoidHighways: !1,
      avoidTolls: !1
      },
      styles: {},
      fusion_options: {},
      directions_panel: null,
      draggable: !1,
      show_infowindows: !0,
      show_markers: !0,
      infowindow_type: “bubble”,
      listeners: {},
      beforeViewAll: function () {},
      afterViewAll: function () {},
      beforeShow: function (a, e, c) {},
      afterShow: function (a, e, c) {},
      afterCreateMarker: function (a, e, c) {},
      beforeCloseInfowindow: function (a, e) {},
      afterCloseInfowindow: function (a, e) {},
      beforeOpenInfowindow: function (a, e, c) {},
      afterOpenInfowindow: function (a, e, c) {},
      afterRoute: function (a,
      e, c) {},
      onPolylineClick: function (a) {}
      };
      this.AddControl(“dropdown”, q);
      this.AddControl(“list”, n);
      f.extend(!0, this.o, a)
      }
      c.prototype.controls = {};
      c.prototype.create_objMap = function () {
      var a = 0,
      b;
      for (b in this.o.styles) this.o.styles.hasOwnProperty(b) && (0 === a && (this.o.map_options.mapTypeControlOptions = {
      mapTypeIds: [d.maps.MapTypeId.ROADMAP]
      }), a++, this.o.map_options.mapTypeControlOptions.mapTypeIds.push(“map_style_” + a));
      if (this.loaded) this.oMap.setOptions(this.o.map_options);
      else try {
      this.map_div.css({
      position: “relative”,
      overflow: “hidden”
      }), this.canvas_map = f(“
      ”).addClass(“canvas_map”).css({
      width: “100%”,
      height: “100%”
      }).appendTo(this.map_div), this.oMap = new d.maps.Map(this.canvas_map.get(0), this.o.map_options)
      } catch (e) {
      this.errors.push(e.toString())
      }
      a = 0;
      for (b in this.o.styles) this.o.styles.hasOwnProperty(b) && (a++, this.oMap.mapTypes.set(“map_style_” + a, new d.maps.StyledMapType(this.o.styles[b], {
      name: b
      })), this.oMap.setMapTypeId(“map_style_” + a));
      this.debug(“01”)
      };
      c.prototype.add_markers_to_objMap = function () {
      var a;
      a =
      this.o.type || “marker”;
      switch (a) {
      case “marker”:
      for (a = 0; a < this.ln; a++) this.create.marker.call(this, a);
      break;
      default:
      this.create[a].apply(this)
      }
      };
      c.prototype.create = {
      marker: function (a) {
      var b = this,
      e = this.o.locations[a],
      c, h, l, m, g = new d.maps.LatLng(e.lat, e.lon),
      r = !1 === e.visible ? !1 : !0;
      f.extend(e, {
      position: g,
      map: this.oMap,
      zIndex: 1E4,
      visible: !1 === this.o.show_markers ? !1 : r
      });
      e.image && (l = e.image_w || 32, m = e.image_h || 32, f.extend(e, {
      icon: new d.maps.MarkerImage(e.image, new d.maps.Size(l, m), new d.maps.Point(0, 0), new d.maps.Point(l /
      2, m / 2))
      }));
      c = new d.maps.Marker(e);
      d.maps.event.addListener(c, “click”, function () {
      b.o.beforeShow(a, e, c);
      h = !1 === e.show_infowindows ? !1 : !0;
      b.o.show_infowindows && h && b.open_infowindow(a, c);
      b.oMap.panTo(g);
      e.zoom && b.oMap.setZoom(e.zoom);
      b.current_control && (b.o.generate_controls && b.current_control.activateCurrent) && b.current_control.activateCurrent.call(b, a + 1);
      b.current_index = a;
      b.o.afterShow(a, e, c)
      });
      this.oBounds.extend(g);
      this.markers.push(c);
      this.o.afterCreateMarker(a, e, c);
      e.visible = r;
      return c
      },
      polyline: function () {
      var a,
      b, e = ;
      for (a = 0; a < this.ln; a++) b = new d.maps.LatLng(this.o.locations[a].lat, this.o.locations[a].lon), e.push(b), this.create.marker.call(this, a);
      f.extend(this.o.stroke_options, {
      path: e,
      map: this.oMap
      });
      this.Polyline ? this.Polyline.setOptions(this.o.stroke_options) : this.Polyline = new d.maps.Polyline(this.o.stroke_options)
      },
      polygon: function () {
      var a = this,
      b, e, c = ;
      for (b = 0; b < this.ln; b++) e = new d.maps.LatLng(this.o.locations[b].lat, this.o.locations[b].lon), c.push(e), this.create.marker.call(this, b);
      f.extend(this.o.stroke_options, {
      paths: c,
      editable: this.o.draggable,
      map: this.oMap
      });
      this.Polygon ? this.Polygon.setOptions(this.o.stroke_options) : this.Polygon = new d.maps.Polygon(this.o.stroke_options);
      d.maps.event.addListener(this.Polygon, “click”, function (b) {
      a.o.onPolylineClick(b)
      })
      },
      fusion: function () {
      f.extend(this.o.fusion_options, {
      styles: [this.o.stroke_options],
      map: this.oMap
      });
      this.Fusion ? this.Fusion.setOptions(this.o.fusion_options) : this.Fusion = new d.maps.FusionTablesLayer(this.o.fusion_options)
      },
      directions: function () {
      var a = this,
      b, c, k, h, l, m = ,
      g = 0;
      for (b = 0; b < this.ln; b++) k = new d.maps.LatLng(this.o.locations[b].lat, this.o.locations[b].lon), 0 === b ? h = k : b === this.ln - 1 ? l = k : (c = !0 === this.o.locations[b].stopover ? !0 : !1, m.push({
      location: k,
      stopover: c
      })), this.create.marker.call(this, b);
      f.extend(this.o.directions_options, {
      origin: h,
      destination: l,
      waypoints: m
      });
      this.directionsService || (this.directionsService = new d.maps.DirectionsService);
      this.directionsDisplay ? this.directionsDisplay.setOptions({
      draggable: this.o.draggable
      }) : this.directionsDisplay =
      new d.maps.DirectionsRenderer({
      draggable: this.o.draggable
      });
      this.directionsDisplay.setMap(this.oMap);
      this.o.directions_panel && (this.o.directions_panel = f(this.o.directions_panel), this.directionsDisplay.setPanel(this.o.directions_panel.get(0)));
      this.o.draggable && d.maps.event.addListener(this.directionsDisplay, “directions_changed”, function () {
      g = a.compute_distance(a.directionsDisplay.directions);
      a.o.afterRoute(g)
      });
      this.directionsService.route(this.o.directions_options, function (b, c) {
      c === d.maps.DirectionsStatus.OK &&
      (g = a.compute_distance(b), a.directionsDisplay.setDirections(b));
      a.o.afterRoute(g, c, b)
      })
      }
      };
      c.prototype.compute_distance = function (a) {
      var b = 0,
      c = a.routes[0],
      d = c.legs.length;
      for (a = 0; a < d; a++) b += c.legs[a].distance.value;
      return b
      };
      c.prototype.type_to_open = {
      bubble: function (a) {
      this.infowindow = new d.maps.InfoWindow({
      content: a.html || “”
      })
      }
      };
      c.prototype.open_infowindow = function (a, b) {
      this.CloseInfoWindow();
      var c = this.o.locations[a],
      d = c.type || this.o.infowindow_type;
      c.html && this.type_to_open[d] && (this.o.beforeOpenInfowindow(a,
      c, b), this.type_to_open[d].call(this, c), this.infowindow.open(this.oMap, b), this.o.afterOpenInfowindow(a, c, b))
      };
      c.prototype.get_html_controls = function () {
      return this.controls[this.o.controls_type] && this.controls[this.o.controls_type].getHtml ? (this.current_control = this.controls[this.o.controls_type], this.current_control.getHtml.apply(this)) : “”
      };
      c.prototype.generate_controls = function () {
      if (this.o.controls_on_map) {
      var a = f(‘
      ’).css(this.o.controls_applycss ? {
      margin: “5px”
      } : {}),
      b = f(this.get_html_controls()).css(this.o.controls_applycss ? {
      background: “#fff”,
      padding: “5px”,
      border: “1px solid rgb(113,123,135)”,
      boxShadow: “rgba(0, 0, 0, 0.4) 0px 2px 4px”,
      maxHeight: this.map_div.find(“.canvas_map”).outerHeight() - 80,
      minWidth: 100,
      overflowY: “auto”,
      overflowX: “hidden”
      } : {});
      a.append(b);
      this.oMap.controls[this.o.controls_position].push(a.get(0))
      } else this.controls_wrapper.empty(), this.controls_wrapper.append(this.get_html_controls())
      };
      c.prototype.init_map = function () {
      var a =
      this,
      b = 0;
      this.Polyline && this.Polyline.setMap(null);
      this.Polygon && this.Polygon.setMap(null);
      this.Fusion && this.Fusion.setMap(null);
      this.directionsDisplay && this.directionsDisplay.setMap(null);
      if (this.markers) {
      for (b in this.markers)
      if (this.markers[b]) try {
      this.markers[b].setMap(null)
      } catch (c) {
      a.errors.push(c)
      }
      this.markers.length = 0;
      this.markers =
      }
      this.o.controls_on_map && this.oMap.controls && this.oMap.controls[this.o.controls_position].forEach(function (b, c) {
      try {
      a.oMap.controls[this.o.controls_position].removeAt(c)
      } catch (e) {
      a.errors.push(e)
      }
      });
      this.oBounds = new d.maps.LatLngBounds;
      this.debug(“02”)
      };
      c.prototype.perform_load = function () {
      1 === this.ln ? (this.oMap.setCenter(this.markers[0].getPosition()), this.ViewOnMap(1)) : 0 === this.ln ? (this.o.map_options.set_center ? this.oMap.setCenter(new d.maps.LatLng(this.o.map_options.set_center[0], this.o.map_options.set_center[1])) : this.oMap.fitBounds(this.oBounds), this.oMap.setZoom(this.o.map_options.zoom)) : (this.oMap.fitBounds(this.oBounds), “number” === typeof (this.o.start - 0) && 0 < this.o.start && this.o.start <=
      this.ln ? this.ViewOnMap(this.o.start) : this.ViewOnMap(this.view_all_key))
      };
      c.prototype.debug = function (a) {
      this.dev && this.errors.length && console.log(a + “: “, this.errors)
      };
      c.prototype.AddControl = function (a, b) {
      if (!a || !b) return !1;
      this.controls[a] = b;
      return !0
      };
      c.prototype.CloseInfoWindow = function () {
      this.infowindow && (this.current_index || 0 === this.current_index) && (this.o.beforeCloseInfowindow(this.current_index, this.o.locations[this.current_index]), this.infowindow.close(), this.infowindow = null, this.o.afterCloseInfowindow(this.current_index,
      this.o.locations[this.current_index]))
      };
      c.prototype.ShowOnMenu = function (a) {
      if (a === this.view_all_key && this.o.view_all && 1 < this.ln) return !0;
      a = parseInt(a, 10);
      if (“number” === typeof (a - 0) && 0 <= a && a < this.ln) {
      var b = !1 === this.o.locations[a].on_menu ? !1 : !0;
      if (!1 !== this.o.locations[a].visible && b) return !0
      }
      return !1
      };
      c.prototype.ViewOnMap = function (a) {
      if (a === this.view_all_key) this.o.beforeViewAll(), this.current_index = a, 0 < this.o.locations.length && (this.o.generate_controls && this.current_control && this.current_control.activateCurrent) &&
      this.current_control.activateCurrent.apply(this, [a]), this.oMap.fitBounds(this.oBounds), this.CloseInfoWindow(), this.o.afterViewAll();
      else if (a = parseInt(a, 10), “number” === typeof (a - 0) && 0 < a && a <= this.ln) try {
      d.maps.event.trigger(this.markers[a - 1], “click”)
      } catch (b) {
      this.errors.push(b.toString())
      }
      this.debug(“03”)
      };
      c.prototype.SetLocations = function (a, b) {
      this.o.locations = a;
      b && this.Load()
      };
      c.prototype.AddLocations = function (a, b) {
      var c = this;
      f.isArray(a) && f.each(a, function (a, b) {
      c.o.locations.push(b)
      });
      f.isPlainObject(a) &&
      this.o.locations.push(a);
      b && this.Load()
      };
      c.prototype.AddLocation = function (a, b, c) {
      f.isPlainObject(a) && this.o.locations.splice(b, 0, a);
      c && this.Load()
      };
      c.prototype.RemoveLocations = function (a, b) {
      var c = this,
      d = 0;
      f.isArray(a) ? f.each(a, function (a, b) {
      b - d < c.ln && c.o.locations.splice(b - d, 1);
      d++
      }) : a < this.ln && this.o.locations.splice(a, 1);
      b && this.Load()
      };
      c.prototype.Loaded = function () {
      return this.loaded
      };
      c.prototype._init = function () {
      this.ln = this.o.locations.length;
      for (var a = 0; a < this.ln; a++) f.extend(this.o.locations[a],
      this.o.commons), this.o.locations[a].html && (this.o.locations[a].html = this.o.locations[a].html.replace(”%index”, a + 1), this.o.locations[a].html = this.o.locations[a].html.replace(“%title”, this.o.locations[a].title || “”));
      this.map_div = f(this.o.map_div);
      this.controls_wrapper = f(this.o.controls_div)
      };
      c.prototype.Load = function (a) {
      f.extend(!0, this.o, a);
      a && a.locations && (this.o.locations = a.locations);
      this._init();
      !1 === this.o.visualRefresh ? d.maps.visualRefresh = !1 : d.maps.visualRefresh = !0;
      this.init_map();
      this.create_objMap();
      this.add_markers_to_objMap();
      1 < this.ln && this.o.generate_controls || this.o.force_generate_controls ? (this.o.generate_controls = !0, this.generate_controls()) : this.o.generate_controls = !1;
      var b = this;
      if (this.loaded) this.perform_load();
      else {
      d.maps.event.addListenerOnce(this.oMap, “idle”, function () {
      b.perform_load()
      });
      d.maps.event.addListener(this.oMap, “resize”, function () {
      b.canvas_map.css({
      width: b.map_div.width(),
      height: b.map_div.height()
      })
      });
      for (var c in this.o.listeners) {
      var k = this.oMap,
      h = this.o.listeners[c];
      this.o.listeners.hasOwnProperty(c) && d.maps.event.addListener(this.oMap, c, function (e) {
      h(k, e)
      })
      }
      }
      this.loaded = !0
      };
      return c
      }();
      “function” == typeof define && define.amd ? define(function () {
      return p
      }) : s.Maplace = p
      })(jQuery, this, google);
      ```


    • >
      Code: #contentarea:after{ content:" "; clear:both; display:block; height:0; } #contentarea{padding-bottom:50px}



      This bit of code fixed the bottom margin issue. Now I have enough space under the maps in every browser.
    • > I’m not keen on the fact that you removed my horizontal scrollbar and fiddled with the viewports vertical scrollbar as your fixed positioned element now sits over the controls for the vertical scrollbar. It’s usually best to avoid touching the html and body overflow properties at all.


      I followed your advice and eliminated the overflow properties, but it caused some issues. I’m not sure if this is the right place to ask but I have a Jquery bit of code that scrolls down to the bottom of the page automatically. When I eliminated those overflow properties, my function stopped working. Do you know any way around this? This is the code for my script:


      $("#html, #body").animate({ scrollTop: this.height() }, "slow"); return false;

    Again, thanks for following up with me!

    Can you highlight more about overflow issue? I am not sure about the issue. Thanks.

    I think you will need to look into the documentation of that Map API as all those styles are added dynamically and will be difficult to over-ride with css and anyway I believe their positioning will be based on their content so changing with css will probably break things.

    e.g.
    you could do this:

    
    
    .gm-style-iw{
    overflow:visible!important;
    height:160px!important;
    }
    .gm-style-iw > div{
    overflow:visible!important;
    font-size:14px!important;
    }
    
    

    But then if may make the text bigger than the dialog box. Have a look in your documentation that you downloaded with maplace but I feel this is js question not a css one.

    I followed your advice and eliminated the overflow properties, but it caused some issues. I’m not sure if this is the right place to ask but I have a Jquery bit of code that scrolls down to the bottom of the page automatically. When I eliminated those overflow properties, my function stopped working. Do you know any way around this? This is the code for my script:

    $("#html, #body").animate({
                        scrollTop: this.height()
                    }, "slow");
                    return false;
    

    [/LIST]

    Which element was being animated?

    Removing the overflow settings should not affect the above routine but it does depend on why you changed them in the first place as you may be doing something special that isn’t evident at first sight.

    Can you highlight more about overflow issue? I am not sure about the issue. Thank

    The original issue was that you had no horizontal scrollbar on the viewport so you couldn’t reach any content if the browser window was smaller than the content.

    The issue with the dialog boxes was fixed by adding the css code you provided. The documentation given with the plugin is not very extensive.

    If you go to this page my jQuery method doesn’t seem to scroll down to the bottom on page load. Is this something than can be fixed with CSS or should I ask in the Jquery section? My body has a height of 100% and there’s another method that determines that height of the content after it renders.

    Thank you!

    I clicked the little orange flag in the bottom left corner of the post and requested that the thread be moved to the JavaScript forum. :slight_smile:

    [edit]It has now been moved
    Mittineague[/edit]

    Hi there,

    When I open the browser console on the page you link to (here’s how), I see:

    Failed to load resource: net::ERR_CONNECTION_REFUSED http://calstateautoparts.com/beta/default/default.css
    Failed to load resource: net::ERR_CONNECTION_REFUSED http://calstateautoparts.com/beta/maplace.min.js
    Uncaught ReferenceError: Maplace is not defined (index):2
    

    You’ll need to fix that first.

    So sorry about that. Seems like I forgot to upload some files. Take a look at it now.

    Hi,

    I’m not 100% sure what you mean here.
    What should scroll down to where?

    Hi! Go to this page. The page should scroll all the way to the bottom when it loads.

    $.load() only accepts one function to be called after the content has been loaded.

    Try this:

    $('#contentarea').load(page, function() {
      if (page.match("home.html")) {
        history.pushState('', document.title, window.location.pathname);
      } else {
        location.hash = hash;
      }
    
      var divHeight = $('#content').height();
      $('#contentarea').outerHeight(divHeight);
    
      $("#html, #body").animate({
        scrollTop: $(this).height()
      }, "slow");
    
      return false;
    });
    

    Should that be:

    
      $("html, body").animate({
    
    

    As I don’t think html and body have ids as such ?

    Hmm… I tried both of your suggestions to no avail.

    The code now looks like this:

    function () {
                    var divHeight = $('#content').height();
    
                    $('#contentarea').outerHeight(divHeight);
    				
    				//scroll to bottom	
    				$("html, body").animate({
                        scrollTop: this.height()
                    }, "slow");
                    return false;
                });
    

    Pullo had :

    scrollTop: $(this).height()

    not

    scrollTop: this.height()

    Fixed that. Still not scrolling down :confused:

    Hi,

    You have this:

    $('#contentarea').load(page, function () {
      if (page.match("home.html")) {
        history.pushState('', document.title, window.location.pathname);
      } else {
        location.hash = hash;
      }
    },
    
    function () {
      var divHeight = $('#content').height();
      $('#contentarea').outerHeight(divHeight);
      $("html, body").animate({
        scrollTop: $(this).height()
      }, "slow");
    
      return false;
    });
    

    You need:

    $('#contentarea').load(page, function () {
      if (page.match("home.html")) {
        history.pushState('', document.title, window.location.pathname);
      } else {
        location.hash = hash;
      }
      
      var divHeight = $('#content').height();
      $('#contentarea').outerHeight(divHeight);
      $("html, body").animate({
        scrollTop: $(this).height()
      }, "slow");
    
      return false;
    });
    

    Also, what is that “return false” doing?

    I put it all in the same function and now it scrolls down automatically! But for some reason, my div height is not being set correctly anymore.

    Thanks again for following up with me.

    Which div height are we talking about and what is the problem exactly?

    Explain should happen and what isn’t happening and it should be easier for us to help you if you can be more specific to the problem :slight_smile: