javascript - Disabling default tooltip -


Here's a tooltip script, it works great in all browsers but the default tooltip is not disabled in IE .

How do I update the following script to disable the default tooltip?

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {// tooltip only text $ ('MasterTooltip'). Hover (function () {// code over title = $ (this) .attr ('title'); $ ( ). Data ('tip text', title) .removeAttr ('title'); $ ('& lt; p class = "tooltip" & gt; & lt; / p & gt;'). Text (title) .appendTo ('(' 'title', $ (this) .data ('tip text')); $ ('.' Tooltip '') Remove ();}) .mausomov (function (e) {var maozax = e PageX + 20; // coordinates var mousse = E. Pagwai + 10; // Yes Y coordinate $ ('. Tooltip'). CSS ({top: mousse, left: mousex})}}}) ; & Lt; / s Crypto & gt;    

There is no reason to add title Back to the element on Blur attribute in the element you have stored it in jQuery metadata. My guess is that this is why IE is still showing it. Remove the line

  $ (this) .attr ('title', $ (this). Data ('tip text'));   

See if it decides.


Edit: Some requirements have gone missing (untested), but can work Interpretation is:

  $ (document) .ready (function () {$ ( 'masterTooltip'). Each (function () {var title = $ (this) .attr ('title'); $ (this) .data ('tiptext', title) .removeAttr ('title');}). Hover (function ($ ('& lt; p class = "tooltip" & gt; & lt; / p & gt;') .text ($ (this) .data ('tip text')) .appendTo ( 'Body') .FadeIn ('slow');}, function () {$ ('. Tooltip') .remove ();}). Mousemove (function (e) {var mousex = e.pagex + 20; var mousse = e. Pagravai + 10; $ ('. Tooltip'). CSS ({top: mouse, left: mousex})}}} ; Note that this sub-optimal is because it calls  $ (this)  twice in the  each  block, but It should be easy enough to recover.   

Comments