SimpleMachines/SMF2.1 — pull request #486 by Yoshi2889 (2013-06-28 12:26:52+00:00)
Title: Easy toggle

Signed-off-by: Rick Kerkhof (my commit is signed)

Prefered method of creating toggles is toggleElementEvent(), because it creates the event and assigns the correct class to the image (if any).

Syntax (toggleElement):
toggleElement(element to toggle (jQuery selector), the item that toggles it (jQuery selector), any image options (see below), the duration of the animation (string or int))

toggleElementEvent is nearly identical, with exception of the last parameter:
toggleElementEvent(element to toggle (jQuery selector), the item that toggles it (jQuery selector), any image options (see below), is collapsed? (bool))

imageoptions consists of:
visibleimage: The image that is shown when the toggled element is visible. (default: upshrink.png, URL to image path)
hideimage: The image that is shown when the toggled element is hidden. (default: upshrink2.png, URL to image path)

visibletxt: The hover text that is shown when the toggled element is visible (default: hide_txt, or "Hide", string)
hidetxt: The hover text that is shown when the toggled element is hidden (default: show_txt or "Show", string)
Both visibletxt and hidetxt are disregarded when the toggle "button" is NOT an image.

isimage: If the toggle "button" is an image. (bool)
eimage: An external image, if wanted. (jQuery selector)

This function aims to replace smc_Toggle.