jQuery UI Slider - Disable click on slider track

后端 未结 13 1361
南方客
南方客 2020-12-31 08:57

I\'m trying to find a way to disable the click on my jQuery UI Slider\'s track. Clicking on the handle is ok but I do not want the handle to respond if the user clicks on t

13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 09:14

    There's a non-JS solution to this as well, using only two lines of CSS:

    /* Supress pointer events */
    #navSlider { pointer-events: none; }
    /* Enable pointer events for slider handle only */
    #navSlider .ui-slider-handle { pointer-events: auto; }
    

提交回复
热议问题