From 5b8b8b5bbab370b8afb5ae19e375ce16d7a91e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 8 Feb 2011 12:03:50 +0100 Subject: [PATCH] Move slider initialization to function --- js/functions.js | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/js/functions.js b/js/functions.js index fba8f9153..f1f0e2271 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2409,6 +2409,25 @@ function PMA_set_status_label(id) { } } +/** + * Initializes slider effect. + */ +function PMA_init_slider() { + $('.pma_auto_slider').each(function(idx, e) { + $('') + .insertBefore(e); + PMA_set_status_label(e.id); + + $('' + e.title + '') + .insertBefore(e) + .click(function() { + $('#' + e.id).toggle('clip'); + PMA_set_status_label(e.id); + return false; + }); + }); +} + /** * Vertical pointer */ @@ -2480,19 +2499,7 @@ $(document).ready(function() { /** * Slider effect. */ - $('.pma_auto_slider').each(function(idx, e) { - $('') - .insertBefore(e); - PMA_set_status_label(e.id); - - $('' + e.title + '') - .insertBefore(e) - .click(function() { - $('#' + e.id).toggle('clip'); - PMA_set_status_label(e.id); - return false; - }); - }); + PMA_init_slider(); }) // end of $(document).ready()