var slider = {
	
		init: function() {

			var selector = "a.ui-slider-handle";
			$('#slider').slider({
				value:160,
				min: 100,
				max: 230,
				slide: function( event, ui ) {
					$('#msg').html( ui.value );
				}
			});
		}
}

$(document).ready(slider.init);

$(document).ready(function(e) {

/*

Touchmove Event:

*/
$('#slider .ui-slider-handle').bind('touchmove', function(event)	{
	
	var e = event.originalEvent;
	event.preventDefault();

	var left = $(this).parent().offset().left;
	var right = left + $(this).parent().width();

	var min = $(this).parent().slider('option', 'min');
	var max = $(this).parent().slider('option', 'max');

	var touchvalue = min + (e.touches.item(0).clientX-left)/(right-left)*(max-min);

	touchvalue = touchvalue <= min ? min : touchvalue; 
	touchvalue = touchvalue >= max ? max : touchvalue; 

	// neuen Wert setzen
	$(this).parent().slider('value', touchvalue);
	
	$('#msg').html( touchvalue );
	
});
	
});
