Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


                <nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
      <a class="navbar-brand" href="#">Bootstrap 3 Dropdown w/ mouse hover</a>
    <div id="navbar" class="collapse navbar-collapse">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">One more separated link</a></li>
        <li><a href="#about">About</a></li>
        <li><a href="#contact">Contact</a></li>
    <!--/.nav-collapse -->
<div class="container">

  <div class="starter-template">
    <h1>Bootstrap 3 Nav Dropdown W/Mouse enter/leave</h1>



                .starter-template {
    padding: 70px 15px;
    text-align: center;


                $( document ).ready(function() {
  /* Set variables  */
  var in_transition = false; // set in_transition back to false at the end of your transition.

  // toggle dropdown on mouse hover, click and tap events
  $('.dropdown').on('mouseenter mouseleave click tap touchstart', function(event) {
    /* We check if we are not in responsive mode by default .navbar-toggle is only visible in 768px and less aak mobile responsive mode. */
    if (!$('.navbar-toggle').is(':visible')) {
      /* We ensure no other animation is runnning first */
      if( in_transition == false ){
        /*Set in transition to true to ensure only one animation at a time*/
        in_transition = true;
      /* Toggle dropdown open/ close  */
        // Do your animation here and upon it's completion set in_transition back to false.
        in_transition = false;