Interface elements for jQuery - Documentation - Slider

Slider

Creates vertical, horizontal or rectacle sliders with one or more indicators.

example

Options:

accept string or DOMElement manadatory the indicators inside the slider
fractions integer optional the slider is devided in fractions. Example: if you use 4 fractions then the indicator snaps to 0%, 25%, 50%, 75%, 100%
onSlide function optional callback triggered while the indicator is moved. Return 4 parameters: x proccentage, y proccentage, x coordonate, y coordonate
onChange function optional callback triggered when the indicator is moved atleast by oen pixel. Return 4 parameters: x proccentage, y proccentage, x coordonate, y coordonate
values array optional array containing arrays of pairs values for the indicators
restricted boolean optional if true the slider indicator can not be moved beyond adjacent indicators

Code sample:

$('.slider1').Slider(
	{
		accept : '.indicator',
		fractions : 4,
		onSlide : function( cordx, cordy, x , y)
		{
		document.getElementById('cordx').value = cordx + '%';
		document.getElementById('cordy').value = cordy + '%';
		},
		values: [
			[70,70]
		]
	}
);

SliderSetValues

You can change the values for indicators in sliders, and so move the indicator acording to the values.

Options:

values array mandatory array containing arrays of pairs values for the indicators
$('.slider1').SliderSetValues(
	[
		[20,50],
		[200,200]
	]
)

Download now

Interface 1.2 146kb (source files, compressed files)
jQuery 1.1.2 19 kb

Linux tutorials · Dedicated servers