문제

I am using Jquery UI's tooltip widget to display help text. I have then added a button to disable the helptext. This is done by using the following when a button is pressed.

$(document).tooltip("disable");   

The problem is when I do this the text in the tag is removed. By enabling the tooltip again the text comes back.

The problem is When the tooltip is enabled the tab in the browers says: "MyCompany" but when the title is removed when disabling the tooltip it changes the https:// mycompany.com.

Is there something I am missing? How do I avoid the page title from being removed?

도움이 되었습니까?

해결책

It seems that using $(document) as a selector for tooltips affects the html <title> tag. The solution is to be more specific with the selector:

$('.has-tooltip').tooltip();

(add a class - eg:has-tooltip - to all the elements that will receive a tooltip).

However, you can use even general selectors, like:

$('*').tooltip();

or

$('body').tooltip();

Update This issue is limited to jQuery versions previous to v2. Using $(document) as selector should work fine for jQuery 2.x. (thanks @Ayman Safadi for your research).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top