我真的很喜欢这种视觉效果。我想通过 touchmove 在 iphone 或 ipad 中使用它。谁能帮我这个?
这是JS:
$(document).bind('mousemove',function(e){
var docW = $(window).width();
var docH = $(window).height();
var diffX = (docW/2) - e.clientX;
var diffY = (docH/2)-100 - e.clientY;
var dist = distance(docW/2,docH/2, e.clientX, e.clientY);
var distM = distance(docW/2,(docH/2)+60, e.clientX, e.clientY);
// eye
var eye_background = Math.floor( diffX /-30 ) +'px '+ Math.floor( diffY /-30 ) +'px';
var eye_translate = Math.floor(diffX/-50 )+'px, '+ Math.floor(diffY/-100 )+'px';
$(".eye").css({"background-position":eye_background, "-webkit-transform":'translate3d('+eye_translate+',0)',"-moz-transform":'translate('+eye_translate+')',"-o-transform":'translate('+eye_translate+')',"-ms-transform":'translate('+eye_translate+')' });
});
基本上,我的问题是如何在苹果上进行这项工作?