I'm using the Tipsy jquery plugin and the focus triggers acts the same way as the hover trigger. Tipsy stops displaying once my mouse is off an input field even though the field is still focused. What could cause this开发者_StackOverflow中文版 issue? Based on this jQuery tipsy plugin. On focus trigger not working. It's not the actual plugin that's causing the issue
Here's the page I'm testing it on
http://uploads.glumbo.com/?op=registration
You will want to update Tipsy file you are using. The one you are using right now is significantly different than the latest version of Tipsy.
As Haochi says, you need to update your Tipsy version to 1.0.0a. Then use the following code to add both hover and focus to your tipsy tooltips (demo):
$('.registerform [title]')
.tipsy({
trigger: 'manual', // manual stops binding of any internal tipsy events
gravity: 'w',
fade: true
})
.bind('focus mouseenter', function(e) {
// flag indicating the input has focus
if (e.type === 'focus') {
$(this).addClass('hasFocus');
}
$(this).tipsy("show");
})
.bind('blur mouseleave', function(e) {
// if mouseleave is triggered but the input has focus, ignore it
if (!$(this).is('.hasFocus') || e.type === 'blur') {
$(this).removeClass('hasFocus').tipsy("hide");
}
});
精彩评论