From a88e07c8f8e98c44051641450ea610998322cc1d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 28 Jan 2013 12:19:23 -0500 Subject: hover over the racecar --- public/javascripts/hover.js | 19 ++++++++++++++++--- public/stylesheets/style.css | 3 ++- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'public') diff --git a/public/javascripts/hover.js b/public/javascripts/hover.js index 1f648e1..fd91ec5 100644 --- a/public/javascripts/hover.js +++ b/public/javascripts/hover.js @@ -65,13 +65,13 @@ var game = { }); $(window).bind({ blur: function (e) { - $("#really_waiting").html("BLUR"); + // $("#really_waiting").html("BLUR"); socket.emit('blur', { id: _id }); own_cursor.blur(); }, focus: function (e) { - $("#really_waiting").html("FOCUS"); - socket.emit('focus', { id: _id }); + // $("#really_waiting").html("FOCUS"); + // socket.emit('focus', { id: _id }); own_cursor.focus(); }, mousemove: function(e){ @@ -79,6 +79,19 @@ var game = { own_cursor.el.css({ 'left': e.pageX, 'top': e.pageY }); } }); + + var hovering = false; + own_cursor.blur(); + $("#racecar").bind({ + mouseover: function(){ + socket.emit('focus', { id: _id }); + own_cursor.focus(); + }, + mouseout: function(){ + socket.emit('blur', { id: _id }); + own_cursor.blur(); + } + }); $(".okfocus").bind({ mouseover: function(){ diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 23c434f..415a0ad 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -357,6 +357,7 @@ header { } .cursor { + pointer-events: none; position: absolute; bottom: 50%; right: 50%; @@ -459,4 +460,4 @@ ol { } .okfocus img { width: 100px; -} \ No newline at end of file +} -- cgit v1.2.3-70-g09d2