Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <main>
      <section class="wrap-map">
        <div class="address-list">
        <ul class="scroll-theme" id="listMapID" data-map-lat="10.754018" data-map-lng="106.740176">
            <li data-map-lat="10.754018" data-map-lng="106.740176">
                <p class="bold"><b>Viễn thông Quốc tế FPT</b></p>
                <p><b>Địa chỉ:</b> Tòa nhà FPT, Lô L.29B-31B-33B đường Tân Thuận, Khu chế xuất Tân Thuận, phường Tân Thuận Đông, quận 7, TP Hồ Chí Minh.
                    <br><b>Hotline:</b> <a href="tel:1900 6973">1900 6973</a>
                </p>
            </li>

            <li data-map-lat="21.028435371671726" data-map-lng="105.78058935714716">
                <p class="bold"><b>Viễn thông Quốc tế FPT</b></p>
                <p><b>Địa chỉ:</b> Toà nhà FPT, Lô 2, đường Phạm Hùng, quận Cầu Giấy, Hà Nội.
                    <br><b>Hotline:</b> <a href="tel:1900 6973">1900 6973</a>
                </p>
            </li>
            <li data-map-lat="10.2488325" data-map-lng="106.374615">
                <p class="bold"><b>bến tre Viễn thông Quốc tế FPT</b></p>
                <p><b>Địa chỉ:</b> Đồng Khởi, Bến Tre.
                    <br><b>Hotline:</b> <a href="tel:1900 6973">1900 6973</a>
                </p>
            </li>
            
        </ul>
        </div>
        <div id="contractMap"></div>
    </section>
</main>


<!-- script -->

<!-- plugin -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDvznRxmwBoEWA2xeJHFwLVG0WbwoS7jkg"></script>
    <!-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYd0KDmTuDnaSM8r9g7p5bna5b5zTzBXg"></script> -->
    <script>
        
        $('.maps').click(function () {
            $('.maps iframe').css("pointer-events", "auto");
        });

        $( ".maps" ).mouseleave(function() {
            $('.maps iframe').css("pointer-events", "none");
        });


        (function ($) {
            $(window).on("load", function () {
                $("#listMapID").mCustomScrollbar({
                    theme: "my-theme",
                    autoHideScrollbar: false
                });
            });
        })(jQuery);

        function initMap() {
            var eMap = document.getElementById('listMapID');
            var centerLatLng = {lat: Number(eMap.getAttribute('data-map-lat')), lng: Number(eMap.getAttribute('data-map-lng'))};
            var map = new google.maps.Map(document.getElementById('contractMap'), {
                zoom: 17,
                center: centerLatLng,
                scrollwheel: false
            });
            $('#listMapID li').each(function (index) {
                var position = {lat: Number($(this).attr('data-map-lat')), lng: Number($(this).attr('data-map-lng'))};
                var title = $(this).find('.name').html();
                var marker = new google.maps.Marker({
                    position: position,
                    map: map,
                    title: title
                });
            });
            $('#listMapID li').on('click', function () {
                var latLng = {lat: Number($(this).attr('data-map-lat')), lng: Number($(this).attr('data-map-lng'))};
                map.panTo(latLng);
            });

        }
        google.maps.event.addDomListener(window, 'load', initMap);
    </script>
              
            
!

CSS

              
                @import url("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css");
.maps iframe{
            pointer-events: none;
        }
        #contractMap{height: 600px}

      .wrap-map {
          position: relative;
      }
      .wrap-map .address-list {
          /*width: 400px;*/
          position: absolute;
          top: 40px;
          right: 40px;
          z-index: 2;
      }
      #listMapID {
          /*float: right;*/
          height: auto;
          width: 100%;
          max-width: 400px;
          background: rgba(255,255,255,.95);
          list-style: none;
          padding: 0 15px;
          display: inline-block;
      }
      #listMapID li {
          cursor: pointer;
          float: left;
          width: 100%;
          padding: 0px 0 10px 0;
          border-bottom: 1px #ddd solid;
          list-style: none;
          margin-top: 15px;
      }
      #listMapID li:hover {_background: #b5d6ff}
      #listMapID li:nth-last-child(1){margin-bottom: 5px; border-bottom: 0px;}
      #listMapID li p {
          margin: 5px 0;
      }
      #listMapID a {
          color: #000;
      }
              
            
!

JS

              
                
              
            
!
999px

Console