123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<div class="row">
  <div class="col-lg-12">
    <div class="ibox float-e-margins">
      <div class="ibox-title">
        <h5>Elements Map </h5>
        <div class="ibox-tools">
          <div class="dropdown">
            <button class="btn btn-default dropdown-toggle btn-xs btn-purple" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
              Views
              <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
              <li class="active" role="presentation"><a role="menuitem" tabindex="-1" href="#1">Map</a></li>
              <li role="presentation"><a role="menuitem" tabindex="-1" href="#2">List</a></li>
            </ul>
          </div>
          <button type="button" class="btn btn-green btn-xs" data-toggle="modal" data-target="#myModal">Reset All</button>
          <div class="modal fade" id="myModal" role="dialog">
            <div class="modal-dialog">
              <div class="modal-content">
                <div class="modal-header">
                  <button type="button" class="close" data-dismiss="modal">
                    <span class="glyphicon glyphicon-remove"></span>
                  </button>
                  <h4 class="modal-title">Element Map</h4>
                </div>
                <div class="modal-body">
                  <p>Are you sure?</p>
                </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
              </div>
            </div>
          </div>
          <button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#myModal">
            <span class="glyphicon glyphicon-fullscreen"></span>
          </button>
          <div class="modal fade" id="myModal" role="dialog">
            <div class="modal-dialog">
              <div class="modal-content">
                <div class="modal-header">
                  <button type="button" class="close" data-dismiss="modal">
                    <span class="glyphicon glyphicon-remove"></span>
                  </button>
                  <h4 class="modal-title">Element Map</h4>
                </div>
                <div class="modal-body">
                  <p>Some text in the modal.</p>
                </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
              </div>
            </div>
          </div>
          <a class="collapse-link">
            <i class="fa fa-chevron-up"></i>
          </a>
        </div>
      </div>
      <div class="ibox-content">
        <div class="active content" id="1">
          Lorem ipsum dolor sit amet, charetra varius quam sit amet vulputate. Quisque mauris augue, molestie tincidunt condimentum vitae, gravida a libero. Lorem ipsum dolor sit amet, charetra varius quam sit amet vulputate. Quisque mauris augue, molestie tincidunt
          condimentum vitae, gravida a libero. Lorem ipsum dolor sit amet, charetra varius quam sit amet vulputate. Quisque mauris augue, molestie tincidunt condimentum vitae, gravida a libero. Lorem ipsum dolor sit amet, charetra varius quam sit amet
          vulputate. Quisque mauris augue, molestie tincidunt condimentum vitae, gravida a libero. Lorem ipsum dolor sit amet, charetra varius quam sit amet vulputate. Quisque mauris augue, molestie tincidunt condimentum vitae, gravida a libero. Lorem
          ipsum dolor sit amet, charetra varius quam sit amet vulputate. Quisque mauris augue, molestie tincidunt condimentum vitae, gravida a libero.
        </div>
        <div class="content" id="2">
          Secondo sed ac orci quis tortor imperdiet venenatis. Duis elementum auctor accumsan. Aliquam in felis sit amet augue. Secondo sed ac orci quis tortor imperdiet venenatis. Duis elementum auctor accumsan. Aliquam in felis sit amet augue. Secondo sed ac
          orci quis tortor imperdiet venenatis. Duis elementum auctor accumsan. Aliquam in felis sit amet augue. Secondo sed ac orci quis tortor imperdiet venenatis. Duis elementum auctor accumsan. Aliquam in felis sit amet augue. Secondo sed ac orci
          quis tortor imperdiet venenatis. Duis elementum auctor accumsan. Aliquam in felis sit amet augue.
        </div>
      </div>
    </div>
  </div>
</div>
            
          
!
            
              .btn-green {
  background-color: #33CC33;
  color: #FFFFFF;
}

.btn-blue {
  background-color: #3333FF;
  color: #FFFFFF;
}

.btn-purple {
  background-color: #CC00FF;
  color: #FFFFFF;
}

.nav-dropdown-style {
  font-weight: 600;
  padding: 4px 12px;
  margin: 14px 5px 5px 20px;
  font-size: 14px;
  float: right;
  background: #1ab394;
}

.nav-dropdown-style:hover {
  background: #199d82;
}

.ibox-content > div {
  display: none;
}
.ibox-content > div.active {
  display: block;
}

            
          
!
            
              var listOptions = $('ul.dropdown-menu > li > a');

listOptions.click(function(ev) {
  var href = $(this).attr('href');
  var divToShow = $(href);
  var contentDivs =    divToShow.parent().find('.content');
 
  contentDivs.removeClass('active');
  divToShow.addClass('active');
});

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console