Disabling browser tooltips on links and s

前端 未结 8 2257
误落风尘
误落风尘 2020-11-29 06:55

I want to suppress the web browser\'s default tooltip display when a user hovers over certain links and elements. I know it\'s possible but I don\'t know how. Can anyone he

8条回答
  •  天命终不由人
    2020-11-29 07:29

    Ran across this thread when using the jQuery plugin timeago. Actually the solution is very simple using the CSS property pointer-events. Posting this for the benefit of people coming here through a search engine :)

    .suppress {
        pointer-events:none;
    }
    

    Note that you shouldn't use this for things like links that should click through to something. In this case use the accepted JS solution.

提交回复
热议问题