Permalink
Browse files

now with added fun of having the pointer pos marked on the axis

  • Loading branch information...
1 parent 22d034b commit 5419a84ed7ce8b78a8939bb386f3490129773d95 @penma committed Jun 21, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 ircvis
View
8 ircvis
@@ -166,13 +166,21 @@ $(window).scroll(function () {
$("#yaxis").css({ left : $(this).scrollLeft() });
});
+$(window).mousemove(function (e) {
+ $("#xmarker").css({ left : e.clientX });
+ $("#ymarker").css({ top : e.clientY });
+});
+
$(function () {
$("body").append($("<div id=\"data\" />").append($("<img>").attr("src", i_d)));
$("body").append($("<div id=\"xaxis\" />").append($("<img>").attr("src", i_x)));
$("body").append($("<div id=\"yaxis\" />").append($("<img>").attr("src", i_y)));
$("#xaxis, #yaxis, #data").css({ position : "absolute", top : "50px", left : "50px", });
+ $("body").append($("<div id=\"xmarker\" />").css({ position : "fixed", top : 0, width : 1, height : 50, backgroundColor : "black" }));
+ $("body").append($("<div id=\"ymarker\" />").css({ position : "fixed", left : 0, width : 50, height : 1, backgroundColor : "black" }));
+
$(window).scroll();
});

0 comments on commit 5419a84

Please sign in to comment.