Move slider initialization to function

This commit is contained in:
Michal Čihař
2011-02-08 12:03:50 +01:00
parent f2e9103f52
commit 5b8b8b5bba

View File

@@ -2409,6 +2409,25 @@ function PMA_set_status_label(id) {
} }
} }
/**
* Initializes slider effect.
*/
function PMA_init_slider() {
$('.pma_auto_slider').each(function(idx, e) {
$('<span id="anchor_status_' + e.id + '"><span>')
.insertBefore(e);
PMA_set_status_label(e.id);
$('<a href="#' + e.id + '" id="anchor_' + e.id + '">' + e.title + '</a>')
.insertBefore(e)
.click(function() {
$('#' + e.id).toggle('clip');
PMA_set_status_label(e.id);
return false;
});
});
}
/** /**
* Vertical pointer * Vertical pointer
*/ */
@@ -2480,19 +2499,7 @@ $(document).ready(function() {
/** /**
* Slider effect. * Slider effect.
*/ */
$('.pma_auto_slider').each(function(idx, e) { PMA_init_slider();
$('<span id="anchor_status_' + e.id + '"><span>')
.insertBefore(e);
PMA_set_status_label(e.id);
$('<a href="#' + e.id + '" id="anchor_' + e.id + '">' + e.title + '</a>')
.insertBefore(e)
.click(function() {
$('#' + e.id).toggle('clip');
PMA_set_status_label(e.id);
return false;
});
});
}) // end of $(document).ready() }) // end of $(document).ready()