Lazy-loading tooltips (twitter bootstrap)
A simple way to reduce load time by waiting to load tooltips until they're needed:
$(document).on('mouseover', '.tip', function () {
if ( $(this).data('isTooltipLoaded') == true ) { return; }
$(this).data('isTooltipLoaded', true).tooltip().trigger('mouseover');
});
Example html:
<p>This required a <span class="tip" title="A premium account is...">premium</span> account.</p>
Written by Gilbert
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Twitter bootstrap
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#