Applying same functionality to separate elements and calling each independently...
I'm trying to apply the following functionality to separate elements and leverage this functionality independently from individual calls:
What the code above does right now is simply slide a div with the class "togged" (funny class name, I know, but eh--the class names "open" and "closed" allow me to simply do some image stuff with the CSS).
//var elem = $('a.toggle');
$(this).text('[ + ]');
$(this).text('[ - ]');
Anyway, this happens whenever a link with the class "toggle" is clicked on. What I would like to do is somehow mold all this to activate ONLY the element(s) somehow indicated or implied to that link. So many something like "<a href="#" title="Toggle Element" id="toggedN">Click Here</a>" where 'N' would be the number appended to the "togged" divs I wish to be toggle-able.
Is there a way to do this? Maybe a better way than what I've described here?