Created
March 13, 2013 19:03
-
-
Save gamanox/5155073 to your computer and use it in GitHub Desktop.
RotateY div on mousemove jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".cont_360").mousemove(function(event) { | |
var msg; | |
var mX = event.pageX; | |
msg = event.pageX + ", " + event.pageY; | |
console.log(msg); | |
if(mX<fullW/2){ | |
var speed = (mX/(fullW/2))*1000; | |
setTimeout(function(){ | |
$(".strip").css({ rotateY: '-='+1 }); | |
}, 1100-speed); | |
} | |
if(mX>fullW/2){ | |
var speed = ((mX-(fullW/2))/(fullW/2))*1000; | |
setTimeout(function(){ | |
$(".strip").css({ rotateY: '+='+1 }); | |
}, 1100-speed); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment