tooltip to follow jquery slider handle?

后端 未结 2 1049
醉话见心
醉话见心 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

    Actually using the title attribute is the easier way ( belugabob idea)

    $(function() {
    
    
      $("#slider").slider()
                    .find(".ui-slider-handle")
                    .attr("title", "Slide Me")
    
    });
    

    However if you want full control use this sample

    Preview: http://jsbin.com/eluqi3/166/edit

    $(function() {
    
      var $slideMe = $("
    ") .css({ position : 'absolute' , top : 10, left : 0 }) .text("Slide Me!") .hide() $("#slider").slider() .find(".ui-slider-handle") .append($slideMe) .hover(function() { $slideMe.show()}, function() { $slideMe.hide()} ) });

提交回复
热议问题