Skip to content

Instantly share code, notes, and snippets.

View garyharan's full-sized avatar

Gary Haran garyharan

View GitHub Profile
$('p[time]').live('mouseover', function() {
var insertion = $(this);
var insertionTime = insertion.attr('time');
var timeSpan = insertion.find('span.time');
if (timeSpan.length) {
timeSpan.show();
} else {
var date = new Date();
date.setTime(insertionTime * 1000);
$(document).ready(function () {
$("a.remove").click(function() {
$.post(this.href, {_method: "delete"});
$(this).parent().remove();
return false;
});
});