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

              
                <div class="container">
  <div class="row">
    <div class="col-md-8 col-md-push-2">
      <h2>Sosial media share buttons using bootstrap popover</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pretium eget diam vel rutrum. Sed aliquam tincidunt gravida. Nam enim arcu, gravida tincidunt interdum nec, euismod feugiat metus. Ut semper dignissim nunc in convallis. In tempor velit massa, vitae scelerisque tellus venenatis sit amet. Vivamus tempor auctor sollicitudin. Nam dolor justo, blandit in vulputate sit amet, vulputate ut mauris. Nullam suscipit quis mi id ultricies.</p>
      <p class="text-center">
        <button type="button" id="btn-share" class="btn btn-simple popover-html" data-container="body" data-toggle="popover" data-placement="top">
          <span>
            <i class="fa fa-share-square-o"></i>
            <strong>Share</strong>
          </span>
        </button>
        <!-- Popover hidden content -->
        <span id="popoverExampleHiddenContent" class="hidden">
          <a target="_blank" href="#" class="btn-media twitter">
            <i class="fa fa-twitter"></i>
          </a>
          <a target="_blank" href="#" class="btn-media facebook">
            <i class="fa fa-facebook"></i>
          </a>
          <a target="_blank" href="#" class="btn-media google-plus">
            <i class="fa fa-google-plus"></i>
          </a>
        </span>
      </p>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pretium eget diam vel rutrum. Sed aliquam tincidunt gravida. Nam enim arcu, gravida tincidunt interdum nec, euismod feugiat metus. Ut semper dignissim nunc in convallis. In tempor velit massa, vitae scelerisque tellus venenatis sit amet. Vivamus tempor auctor sollicitudin. Nam dolor justo, blandit in vulputate sit amet, vulputate ut mauris. Nullam suscipit quis mi id ultricies.</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                .btn-simple {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  text-decoration: underline !important;
  padding:0 !important;
  margin:0 !important;
  &>span{
    /* avoid button movement on click IE */
    position:relative;
  }
}

#btn-share {
  position: relative;
  background: transparent;
  .popover {
    padding: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    .popover-content {
      width: 234px;
      height: 49px;
      margin: 0;
      padding: 0;
      .btn-media {
        width: 78px;
        height: 49px;
        line-height: 49px;
        float: left;
        color: #fff;
        text-align: center;
        background: #052536;
        &.twitter {
          border-top-left-radius: 4px;
          border-bottom-left-radius: 4px;
        }
        &.google-plus {
          border-top-right-radius: 4px;
          border-bottom-right-radius: 4px;
        }
        &.facebook {
          border-left: 1px solid #264356;
          border-right: 1px solid #264356;
          &:after {
            position: absolute;
            bottom: -10px;
            margin-left: -21px;
            content: "";
            border-left: 11px solid transparent;
            border-right: 11px solid transparent;
            border-top: 10px solid #052536;
          }
        }
        &:hover,
        &:focus {
          background: #264356;
          &.facebook {
            &:after {
              border-top-color: #264356;
            }
          }
        }
        i {
          font-size: 30px;
          line-height: 49px;
        }
      }
    }
  }
}
              
            
!

JS

              
                // default init
//$(function () {
//  $('[data-toggle="popover"]').popover()
//})

$("#btn-share").popover({
  html : true, 
  container : '#btn-share',
  content: function() {
    return $('#popoverExampleHiddenContent').html();
  },
  template: '<div class="popover" role="tooltip"><div class="popover-content"></div></div>'
});

$(document).click(function (event) {
  			// hide share button popover
        if (!$(event.target).closest('#btn-share').length) {
            $('#btn-share').popover('hide')
        }
    });

$("a.twitter").attr("href", "https://twitter.com/home?status=" + window.location.href);
$("a.facebook").attr("href", "https://www.facebook.com/sharer/sharer.php?u=" + window.location.href);
$("a.google-plus").attr("href", "https://plus.google.com/share?url=" + window.location.href);



              
            
!
999px

Console