diff options
| author | Jules Laplace <jules@okfoc.us> | 2013-01-28 17:32:04 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2013-01-28 17:32:04 -0500 |
| commit | 708218bf19f71d141d0bdd1a0fb86924e8eeab25 (patch) | |
| tree | 177856f1b2763aa17630f6bef1e658dc6a528aac /public/javascripts/hover.js | |
| parent | f54b45651d5b18db3d6ed54b025dec902db872be (diff) | |
hover over transparent parts of png
Diffstat (limited to 'public/javascripts/hover.js')
| -rw-r--r-- | public/javascripts/hover.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/public/javascripts/hover.js b/public/javascripts/hover.js index fd91ec5..5ab7cdc 100644 --- a/public/javascripts/hover.js +++ b/public/javascripts/hover.js @@ -72,7 +72,7 @@ var game = { focus: function (e) { // $("#really_waiting").html("FOCUS"); // socket.emit('focus', { id: _id }); - own_cursor.focus(); + // own_cursor.focus(); }, mousemove: function(e){ emit_mouse_movement(e); @@ -82,17 +82,21 @@ var game = { var hovering = false; own_cursor.blur(); - $("#racecar").bind({ - mouseover: function(){ + + $("#racecar").hoverpng({ + mouseover: function(e){ socket.emit('focus', { id: _id }); own_cursor.focus(); - }, - mouseout: function(){ + }, + mousemove: function(e){ + }, + mouseout: function(e){ socket.emit('blur', { id: _id }); own_cursor.blur(); - } - }); - + }, + threshold: 0.8 + }); + $(".okfocus").bind({ mouseover: function(){ own_cursor.el.hide(); @@ -247,7 +251,7 @@ function Cursor ( user, now ) { base.update = function(now){ var howlong = Math.floor( (now - base.start) ) + base.initial - base.delay; - base.time.html( timeInSecs( howlong ) ); + base.time.html( timeInMillisecs( howlong ) ); if (base.score) { base.score.update( howlong ); } |
