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

前端 未结 4 1424
北海茫月
北海茫月 2021-01-18 04:42

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!

4条回答
  •  悲哀的现实
    2021-01-18 05:33

    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
    });    
    

提交回复
热议问题