i want to make a slider to adjust start and end value for specific field like

http://www.bluenile.com/build-your-own-diamond-ring?action=add&pid=LD016...,

Please guide me how we can do in Drupal 6 or Drupal 7

Thanks in Advance !!!

Comments

jaypan’s picture

Your best bet is to incorporate the jQuery UI library (there is a drupal jQuery UI module for D6, not sure about D7). It provides a slider method, in which you can define callbacks that can post to the server.

Contact me to contract me for D7 -> D10/11 migrations.

visabhishek’s picture

I checked that (jQuery UI library ) But i can't found any slider to adjust 2 values (Like Start and End ) here available silder adjust only one value.

jaypan’s picture

Look deeper - I just used it on a project last month. They have the slider, and you can set as many handles as you want.

Contact me to contract me for D7 -> D10/11 migrations.

visabhishek’s picture

Will you please give the code sample for that ???

jaypan’s picture

Sure. I'm showing the relevant code for the slider only:

$("#sell_price_slider").slider(
{
	handles:[
	{
		start:1,
		min:1,
		max:9,
		id:'sell-price-slider-min'
	},
	{
		start:9,
		min:2,
		max:9,
		id:'sell-price-slider-max'
	}],
	range: true,
	min: 1,
	max: 9,
	slide:function(e, ui)
	{
		// events while the slider is being slid go here
	},
	stop:function(e,ui)
	{
		// events when the slider stops go here
	}
});

Contact me to contract me for D7 -> D10/11 migrations.

visabhishek’s picture

Thank You So much !!!

msti’s picture

Drupal developer and consultant
http://www.mikestiv.com