隐藏默认标题工具提示

时间:2015-08-19 17:58:26

标签: jquery html css

enter image description here

我们可以看到上面的图片,在"创建"按钮,两个工具提示即将到来。这里我不想要默认的工具提示(下面的小一点)。

我只想显示自定义工具提示

我的代码:



<style>
button[title]:hover:before {
  content: attr(title);
  padding: 2px 2px;
  color: #333;
  position: absolute;
  left: 100px;
   top: 320px; 
  z-index: 20;
  white-space: nowrap;
  -moz-border-radius: 2px;
  -webkit-border-radius: 2px;
  border-radius: 2px;
  -moz-box-shadow: 0px 0px 4px #222;
  -webkit-box-shadow: 0px 0px 4px #222;
  box-shadow: 0px 0px 4px #222;
  background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
  background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}
  </style>

<button onclick="setActionAndSubmit('id_form_workitem_create', 'create');" title="please fill all mandatory fields">
									 	Create
</button>
&#13;
&#13;
&#13;

请提前帮助,请提供帮助

2 个答案:

答案 0 :(得分:2)

显示的是出现的小工具提示,因为您在DOM节点中设置了title属性。在下面的JSFiddle中,提出的解决方案是更改保存按钮和CSS中工具提示内容的属性。

JSFiddle

答案 1 :(得分:0)

您要取出的内容来自您的title属性 - 如果您删除该属性,它将会删除它,但您必须更改您的选择器并对您的内容进行硬编码因为这两个都依赖于那里的头衔。