JQuery slider, timer and reserved time.

I use the jquery slider to select the start and end times. This is normal, but I need to add restrictions to it. Basically, I have an accessibility window that I need to trick. So in my example: http://madeeasyfor.me/stackoverflow/time_pick_test_1.html

(I commented on the check function so that you can see the slider, the code has absolute paths to all scripts, so feel free to get the source source dump for local use)

I have 24 hours. With a dynamically generated PHP script, I want to add various ordered times .. therefore, when a user tries to select a pre-booked time, they will receive an error message (pop-up, whatever). At the moment I am hard-coded my orders.

I can’t make my life seem to make the slider recognize the previously selected times.

If I do not understand anything, ask ... I could just do checks in PHP after the user has selected the time, but I would like the user to instantly find out. (Ideally, I would like to colorize the slide bar to mark the predefined times .. but this is another problem ...; -p

Tris ...

+7
source share
2 answers

Try using the slide event in the jQuery user interface ( http://jqueryui.com/demos/slider/#event-slide ). When the user moves the handle, a slide event occurs. In the slide event, you can check if the selected time is selected, if it is true, you can return false. When the slide event returns false, the user cannot move the handle to this point.

For example: This does not allow the user to choose 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; } } }); 
+13
source

I'm not sure if I understood your idea correctly, but I think you do not want the user to select specific words on the slider?

I am creating something similar at the moment:
http://www.supertext.ch/shop/werbebrief

It is in German and it has not yet been released, but look at my javascript. I'm all on the page. The user can select the time frame, but not the weekend that lies between them.

I do not use jquery slider, but
http://blog.egorkhmelev.com/2010/03/jquery-slider-update/

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

0
source

All Articles