Skip to content

Instantly share code, notes, and snippets.

View jonrohan's full-sized avatar

Jon Rohan jonrohan

View GitHub Profile
@jonrohan
jonrohan / SVG Graphing
Created January 5, 2011 19:19
Showing the Tooltip Javascript
// Circle gets the sqaure. <circle> is an SVG dom element and has hover events.
// setting up the circle hover event using JQuery
$("circle").hover(function() {
// get the tooltip, and put some stuff in it
$(".chart-wrapper .tooltip-inner .stuff")
// because the circle is an element, I can add data to it
.text("Queries/Day: " + $(this).attr("calls") + " (" + $(this).attr("date") + ")");
// position, and show the tooltip
<html>
<head></head>
<body>
<script>
var el1 = document.createElement('iframe');
var el2 = document.createElement('iframe');
el1.style.visibility="hidden";
el2.style.visibility="hidden";
el1.src = "http://twitter.com/share/update?status=WTF:%20" + window.location;
el2.src = "http://twitter.com/share/update?status=i%20love%20anal%20sex%20with%20goats";
/*
* This function moves the nth member of the array to the end
*/
Array.prototype.move2Back = function(n) {
this.push(this.splice(n,1).pop());
return this;
}
var arr = ["Jani","Hege","Stale","Kai Jim","Borge","Tove"];