src/main/java/com/gitblit/wicket/pages/scripts/imgdiff.js
/** Mousemove event handler to track the mouse and move the slider. Generates slider:pos events. */
Mousemove event handler to track the mouse and move the slider. Generates slider:pos events.
Mousemove event handler to track the mouse and move the slider . Generates slider : pos events .
function track(e) {
		var pos = $elem.offset().left;
		var width = $elem.innerWidth();
		var handleWidth = $handle.outerWidth(false);
		var range = width - handleWidth;
		if (range <= 0) return;
		var delta = Math.min(range, Math.max (0, e.pageX - pos - handleWidth / 2));
		lastRatio = delta / range;
		$handle.css('left', "" + (delta * 100 / width) + '%');
		$elem.trigger('slider:pos', { ratio: lastRatio, handle: $handle[0] });
	}
function track ( e ) { var pos = $elem . offset ( ) . left ; var width = $elem . innerWidth ( ) ; var handleWidth = $handle . outerWidth ( false ) ; var range = width - handleWidth ; if ( range <= 0 ) return ; var delta = Math . min ( range , Math . max ( 0 , e . pageX - pos - handleWidth / 2 ) ) ; lastRatio = delta / range ; $handle . css ( 'left' , "" + ( delta * 100 / width ) + '%' ) ; $elem . trigger ( 'slider:pos' , { ratio : lastRatio , handle : $handle [ 0 ] } ) ; }
Mousemove event handler to track the mouse and move the slider.
Mousemove event handler to track the mouse and move the slider .