I'm trying to recreate the hover/mouse move effect the statue's in the background have on: http://toyfight.co/
What I've currently got is
$('.phone-container').on('mousemove',function(e){
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetLeft;
$('.phone-front').css({'right': x});
$('.phone-front').css({'bottom': y});
});
Which makes the phone move, but I don't know how to limit it and create the same smooth effect.
http://codepen.io/salman15/pen/evQVLV
Can one of you guys explain to me how it's best done?