From 3877324fd8ddad36531fb80a5a2ae261015b9780 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 25 May 2009 17:30:57 -0400 Subject: Updated JS to show/hide attachment thumbnails with timers. Minor markup changes. --- js/util.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'js') diff --git a/js/util.js b/js/util.js index cba6f822e..b1b6ec82b 100644 --- a/js/util.js +++ b/js/util.js @@ -18,18 +18,26 @@ $(document).ready(function(){ $('a.attachment').click(function() {$().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; }); - $('a.thumbnail').hover( + $("a.thumbnail").hover( function() { - anchor = $(this); - $.get($('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) { - anchor.append(data); - $('#thumbnail').fadeIn('def'); - }); + var anchor = $(this); + $("a.thumbnail").children('img').remove(); + + setTimeout(function() { + anchor.closest(".entry-title").addClass('ov'); + $.get($('address .url')[0].href+'/attachment/' + (anchor.attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) { + anchor.append(data); + }); + }, 250); + + setTimeout(function() { + anchor.children('img').remove(); + anchor.closest(".entry-title").removeClass('ov'); + }, 3000); }, function() { - setTimeout(function() { - $('#thumbnail').fadeOut('slow', function() {$(this).remove();}); - }, 500); + $(this).children('img').remove(); + $(this).closest(".entry-title").removeClass('ov'); } ); -- cgit v1.2.3-54-g00ecf