Callbacks and re-executing a function after another function has completed

Hi there,

I have the following code:

function accordion() {

	    function() {
	      var checkElement = $(this).next('.toggle');
	      if(!':visible')) {


The .each() snippet is correctly being rendered on document load, however I would like it to be re-executed each time the .click() snippet is executed.

I believe what I require is for my .each() snippet to be established as a callback so that it can be referenced by my .click() snippet. Is this the correct way of thinking?

Could someone give me a rough idea of how this can be done?

Thanks for any help you can give me.