From 84edf12791dc3d44625b156cda6296f1f74f8a9d Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Mon, 25 May 2009 11:13:13 -0400 Subject: Display thumbnail on hover over links in notices when appropriate. --- js/util.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js') diff --git a/js/util.js b/js/util.js index b6848abaa..9ee2a1963 100644 --- a/js/util.js +++ b/js/util.js @@ -25,6 +25,19 @@ $(document).ready(function(){ //need to link to proper url depending on site config (path name and theme, for instance) $('a.attachment').click(function() {$().jOverlay({url:'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; }); $('.entry-title a.attachment').append(' Attachment'); + $('a.thumbnail').hover(function() { + anchor = $(this); + $.get('/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) { + anchor.append(data); + $('#thumbnail').fadeIn('def'); + }); + }, + function() { + setTimeout(function() { + $('#thumbnail').fadeOut('slow', function() {$(this).remove();}); + }, 500); + } + ); // count character on keyup function counter(event){ -- cgit v1.2.3-54-g00ecf