Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[head Yent.top]">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
  <title>JS Bin</title>
</head>
<body>
<div class="parent">
  <div id="top-worst" class="item" data-toggle="tooltip" data-placement="bottom" title="Tooltip to worst"></div>
  <div class="item"></div>
  <div class="item" data-toggle="tooltip" data-color="#222" data-placement="bottom" title="Tooltip to sub normal"></div>
  <div class="item" style="flex-basis:13%;"></div>
  <div class="item" style="flex-basis:28%;"></div>
  <div class="item" style="flex-basis:12%;" data-toggle="tooltip" data-placement="bottom" title="Tooltip to very good"></div>
</div>
  <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>
</html>
 
$(document).ready(function(){
    $('[data-toggle="tooltip"]').tooltip({
      //delay: { "show": 400, "hide": 400 }
    }).colortips();
});
/*
<!-- Generated markup by the plugin -->
<div class="tooltip bs-tooltip-top" role="tooltip">
  <div class="arrow"></div>
  <div class="tooltip-inner">
    Some tooltip text!
  </div>
</div>
*/
(function($) {
    $.fn.colortips = function( options ) {
        /*
        var settings = $.extend({
            text         : 'Hello, World!',
            color        : null,
            fontStyle    : null
        }, options);
        */
        return this.each(function() {
          var tt = $(this);
          tt.on('focus mouseenter', function(){
            var bc = tt.css('background-color');
            var tc = (tt.data('color')===undefined || tt.data('color')==='') ? '' : tt.data('color');
            var pt = tt.data('placement');
            $('.bs-tooltip-bottom.show .tooltip-inner').css({
              'background-color': bc,
              'color': tc
            });
            $('<style id="colortips-style">.bs-tooltip-bottom.show .arrow::before{border-'+pt+'-color: '+bc+';}</style>')
              .appendTo('head');
          }).on('focusout mouseleave', function(){
            $('.bs-tooltip-bottom.show .tooltip-inner').css({
              'background-color': '',
              'color': ''
            });
            $('#colortips-style').remove();
          });
        });
    }
}(jQuery));
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
deedpro
0viewers