// this tells jquery to run the function below once the DOM is read jQuery(document).ready(function() { // append show/hide links to the element directly preceding the element with a class of "toggle" jQuery(".toggle").prev().append(' [show/hide description] '); // hide all of the elements with a class of 'toggle' jQuery('.toggle').hide(); // capture clicks on the toggle links jQuery('a.toggleLink').click(function() { // toggle the display jQuery(this).parent().next('.toggle').slideToggle('slow'); // return false so any link destination is not followed return false; }); // toggles the slickbox on clicking the noted link - HIDE $('#slickhide-toggle').click(function() { jQuery('.toggle').slideUp('slow'); return false; }); // toggles the slickbox on clicking the noted link - SHOW $('#slickshow-toggle').click(function() { jQuery('.toggle').slideDown('slow'); return false; }); // Open All $("#OpenAll").click(function() { jQuery('.toggle').slideDown('slow'); return false; }); //Close All $("#CloseAll").click(function() { jQuery('.toggle').slideUp('slow'); return false; }); });