开发者

Stop JQuery Tools Tooltip from appearing on undefined title values

<input id="name" name="user[name]" size="30" title="Please enter a valid name." type="text" />
<input id="email" name="user[email]" size="30" type="text" />

$(document).ready(function(){
  $(':text').tooltip({
    events: {
      input: 'mouseover, mouseout'
    },
    opacity: 0.95,
    position: 'top center',
    effect: 'slide',
    tip: 'test.field-tip',
    onBeforeShow: function(args){
      if(this.getTrigger().data('title') == und开发者_运维技巧efined)
        return true;
      return false;
    }
  });
});

The tooltip should only appear the on name since it is the only field with a given title. That's how I'm trying to approach it, but it doesn't seem to work. Any ideas?


Change your selector to

$(":text[title]")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜