Is there a way to have the title attribute of an html element to display for a longer time?

别等时光非礼了梦想. 提交于 2019-12-19 18:48:49

问题


Without using tooltip plugins or such, is there a way to extend the duration of time that the title attribute of an html element will display for?

thanks!


回答1:


No. The tooltip you see by default is a function of the browser and is not controllable from the page markup. Your only option is some form of javascript-based tooltip.




回答2:


Are you looking to extend the time tooltips display on your own machine, or on a client machine?

If you are changing the amount of time you want tooldips to display, then you'll create your own tooltips with javascript or some fancy CSS.

I use a jquery function that handles tooltips. You set tooltips to disappear after a set amount of time.

There are a bunch of options available. Google Search

In whatever the tooltip's end event, probably a .mouseout(function(){ type of event you'd just change something that looks like

.mouseout(function(){
    //some code that gets rid of the tooltip, like my_tooltip.css({left:"-9999px"});
});

to

.mouseout(function(){
   setTimeout(function(){
     //some code that gets rid of the tooltip, like my_tooltip.css({left:"-9999px"});
   }), 1000); //<- one second
});    



回答3:


No, and it varies between browsers.




回答4:


The tooltip you're on about here is something that's dependant on the browser. The browser (or the operating system) defines how long this tooltip shows for.

Unless you want to change the browser, and provide all visitors to your site with that browser version, then I'd suggest you use a javascript solution for tooltips.



来源:https://stackoverflow.com/questions/1245936/is-there-a-way-to-have-the-title-attribute-of-an-html-element-to-display-for-a-l

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!