tooltip to follow jquery slider handle?

后端 未结 2 1037
醉话见心
醉话见心 2021-02-20 11:51

I am wondering if it would be possible to attach a tooltip to the slider handle? My current slider function is:

            $(\'#slider\').slider({
                     


        
2条回答
  •  耶瑟儿~
    2021-02-20 12:45

    Just about any HTML element can be assigned a tooltip by giving it a 'title' attribute with the requred text being the value of the attribute.

    In the case of your slider, can you reliably locate the HTML element used to draw the handle of the slider? If so, simply add a title attribute and you should be in business.

    EDIT: Just as a general point, judicious use of the title attribute can make your pages tidier - by adding information that is context sensitive you don't take up screen real estate until it is actually required, and help out those who are unfamiliar with the UI of your site.

提交回复
热议问题