Skip to content

Commit

Permalink
Added units. Make mousemove event standard compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
sedovsek committed Aug 12, 2014
1 parent bf084e2 commit 2a5a036
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions jquery.aim.js
Expand Up @@ -15,19 +15,18 @@

var v = {x: 0, y: 0},
vd = 0,
p = {x: 0, y: 0},
p = {x: 0, y: 0},
t = 12,
mouseX = 0,
mouseY = 0,
DEBUG = false,
anticipator = {
size: 50,
center: {x: 0, y: 0},
effectiveSize: 1
};
mouseX = 0,
mouseY = 0,
DEBUG = false,
anticipator = {
size: 50,
center: {x: 0, y: 0},
effectiveSize: 1
};
anticipator.rect = {x0: 0, y0: 0, x1: anticipator.size, y1: anticipator.size};


/*
* Default anticipate function
*
Expand Down Expand Up @@ -160,10 +159,10 @@
id: 'jquery-aim-debug'
})
.css({
width: 2 * s,
height: 2 * s,
'margin-left': -s,
'margin-top': -s,
width: 2 * s + 'px',
height: 2 * s + 'px',
'margin-left': -s + 'px',
'margin-top': -s + 'px',
top: 0,
left: 0,
border: '2px solid #333',
Expand Down Expand Up @@ -200,13 +199,12 @@
elementList.push($this);
addProperties($this);
$this.data('aim-data').options = opts;

}

$().ready(function() {
document.addEventListener('mousemove', function(e) {
mouseX = e.x,
mouseY = e.y; //TO-DO: check if pageX, pageY is cross-browser or this one
mouseX = e.clientX,
mouseY = e.clientY;
}, false);
});

Expand Down

0 comments on commit 2a5a036

Please sign in to comment.