Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $( '[data-toggle="tooltip"]', '.office-map' ).on( 'shown.bs.tooltip', function ( e ) {
- var targetElem = $( e.target ),
- tooltipID = targetElem.attr( 'aria-describedby' ),
- tooltipElem = $( '#' + tooltipID ),
- tooltipTimeout;
- targetElem.on( 'mouseenter', function() {
- $( this ).addClass( 'hover' );
- clearTimeout( tooltipTimeout );
- } );
- targetElem.on( 'mouseleave', function() {
- $( this ).removeClass( 'hover' );
- } );
- tooltipElem.on( 'mouseenter', function() {
- $( this ).addClass( 'hover' );
- clearTimeout( tooltipTimeout );
- } );
- tooltipElem.on( 'mouseleave', function() {
- $( this ).removeClass( 'hover' );
- tooltipTimeout = setTimeout( function() {
- targetElem.tooltip( 'hide' );
- }, 200 );
- } );
- targetElem.on( 'hide.bs.tooltip', function( e ) {
- if ( tooltipElem.hasClass( 'hover' ) || targetElem.hasClass( 'hover' ) ) {
- e.preventDefault();
- }
- } );
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement