Bootstrap Tutorial - Hover to show tooltip








The following code shows how to hover to show tooltip.

Example

<!-- w  w  w .  ja v  a2  s  . co  m-->

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/css/bootstrap.min.css">
<script type='text/javascript'>
$(window).load(function(){
 $(function(){          
    $("#plus").tooltip({
        placement: 'bottom',
        trigger: 'hover',
        title : 'test'
    });
    $('#minus').tooltip({
        placement: 'bottom',
        trigger: 'hover',
        title : 'test'
    });
}); 
});
</script>
</head>
<body style='margin:30px'>
  <button class="btn" type="button" id="plus">
    <i class="icon-plus-sign"></i>
  </button>
  <button class="btn" type="button" id="minus">
    <i class="icon-minus-sign"></i>
  </button>
</body>
</html>

Click to view the demo