开发者

Stop JQuery Tools Tooltip from appearing on undefined title values

开发者 https://www.devze.com 2022-12-11 16:55 出处:网络
<input id=\"name\" name=\"user[name]\" size=\"30\" title=\"Please enter a valid name.\" type=\"text\" />
<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

精彩评论

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