reversing the dircetion to be dragged

I have a piece of code in this fiddle, which simulates an iphone unlock screen, and i would now like to reverse the direction of dragging to unlock such that users drag from right to left to perform the unlock actions.

and this is the fiddle:
EnRico LamAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Quick and dirty

Change jQuery to this
$(function() {
$('#slider').css({left: '555px'});
		axis: 'x',
		containment: 'parent',
		drag: function(event, ui) {
			if (ui.position.left <= 0) {
			} else {
			    // Apparently Safari isn't allowing partial opacity on text with background clip? Not sure.
				// $("h2 span").css("opacity", 100 - (ui.position.left / 5))
		stop: function(event, ui) {
			if (ui.position.left > 1) {
					left: '555px'
	// The following credit:
	$('#slider')[0].addEventListener('touchmove', function(event) {
	    var el =;
	    var touch = event.touches[0];
	    curX = touch.pageX - this.offsetLeft - 73;
	    if(curX > 550) return;
	    if(curX <= 0){
	    } = 'translateX(' + curX + 'px)'; 
	}, false);
	$('#slider')[0].addEventListener('touchend', function(event) { = '-webkit-transform 0.3s ease-in';
	    this.addEventListener( 'webkitTransitionEnd', function( event ) { = 'none'; }, false ); = 'translateX(555px)';
	}, false);


Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EnRico LamAuthor Commented:
thx a ton, my first question here, lot better than S.O. , a helpful experienced expert.
Julian HansenCommented:
You are most welcome
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.