jquery slider, time picker and reserved times..

痞子三分冷 提交于 2019-11-30 20:08:24

Try using the 'slide' event in jQuery UI (http://jqueryui.com/demos/slider/#event-slide). When the user slides the handle, the slide event is triggered. In the slide event you can check if the selected time is pre booked, if true, you can return false. When the slide event returns false, the user isn't possible to slide the handle to that point.

For example: This prevents the user from selecting something between 40 and 50:


$('#slider').slider({
    range: true,
    values: [17, 67],
    slide: function(event, ui) {
        if(ui.value > 40 && ui.value < 50){
            return false;
        }
    }
});

I'm not sure if I got your idea right, but I guess you don't want to let the user select certain times on the slider?

I'm building something similar at the moment:
http://www.supertext.ch/shop/werbebrief

It's in german and it's not released yet, but have a look at my javascript. I's all in the page. The user can select a timeframe, but not the weekend days that are inbetween.

I'm not using the jquery slider, but
http://blog.egorkhmelev.com/2010/03/jquery-slider-update/

Have a look and let me know if you need help.

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