X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fcrosshair.html;h=37b6daa8758bc1dafef61f6fa5a8f2c046d200de;hb=e1242d5b540803a1848481ce75932a85693de74c;hp=c444686f16b67ffcf532b4275977cbff50fa0a67;hpb=54425b14df388e9337a1d77876512bb60ba74c3b;p=dygraphs.git diff --git a/tests/crosshair.html b/tests/crosshair.html index c444686..37b6daa 100644 --- a/tests/crosshair.html +++ b/tests/crosshair.html @@ -1,15 +1,34 @@ + crosshairs - - - - + + + +

Hover, click and zoom to test the callbacks:

@@ -29,40 +48,32 @@ highlightCallback: function(e, x, pts) { for (var i = 0; i < pts.length; i++) { var y = pts[i].canvasy; - lines[i].style.display = ""; + lines[i].style.visibility = "visible"; lines[i].style.top = y + "px"; if (i == 0) xline.style.left = pts[i].canvasx + "px"; } - xline.style.display = ""; + xline.style.visibility = "visible"; }, unhighlightCallback: function(e) { for (var i = 0; i < 2; i++) { - lines[i].style.display = "none"; + lines[i].style.visibility = "hidden"; } - xline.style.display = "none"; + xline.style.visibility = "hidden"; } } ); for (var i = 0; i < 2; i++) { var line = document.createElement("div"); - line.style.display = "none"; - line.style.width = "100%"; - line.style.height = "1px"; - line.style.backgroundColor = "black"; - line.style.position = "absolute"; + line.className = "line yline"; document.getElementById("div_g").appendChild(line); lines.push(line); } xline = document.createElement("div"); - xline.style.display = "none"; - xline.style.width = "1px"; - xline.style.height = "100%"; + xline.className = "line xline"; xline.style.top = "0px"; - xline.style.backgroundColor = "black"; - xline.style.position = "absolute"; document.getElementById("div_g").appendChild(xline);