JQuery Plugin Repository

Close Complete List of Plugins

toggleModule  |  Category: General  |  Modified: 11 Aug 2009  |  Show and hide specified page modules.

This plugin provides a visibility toggle to the specified block element, and adds a control to its wrapper element. The user can then show and hide only those modules they need to see at a given time.

Summary

Script File

jq.toggleModule.js ( view )

Available Options

initialState

A string specifying whether the associated module should be displayed or hidden on initial page load. Available options include:

  • "visible"
  • "hidden"

Default value is "visible".

moreText

A string used to provide additional detail to the control label. Default values are "Show" and "Hide" depending on the module's visibility.

Basic Usage

$("ELEMENT").toggleModule();

$("ELEMENT").toggleModule({ options });

Minimum Browser Support

  • Apple Safari 3
  • Google Chrome 1
  • Microsoft Internet Explorer 6
  • Mozilla Firefox 3
  • Opera 9

Example 1

This module uses the default settings, initially visible and a generic control label.

Associated Code

<script type="text/javascript">
$(document).ready(function() {
  $("#modDemo1").toggleModule();
  });
</script>

Example 2

This module includes more detailed text clarification on the control label.

Associated Code

<script type="text/javascript">
$(document).ready(function() {
  $("#modDemo2").toggleModule({
    moreText : "Example 2"
    });
  });
</script>

Example 3

This module is initially hidden on page load, and includes more detailed text clarification on the control label.

Associated Code

<script type="text/javascript">
$(document).ready(function() {
  $("#modDemo3").toggleModule({
    initialState : "hidden",
    moreText     : "Example 3"
    });
  });
</script>

JQuery Plugin Repository | Home | Print

back to ksscholl.com