jasonlau / jQuery-jlVisi

jlVisi is a jQuery plugin designed to toggle the visibility of webpage elements.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

 jlVisi - A jQuery plugin
==================================================================
©2011 JasonLau.biz
==================================================================
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
==================================================================
Description
==================================================================

jlVisi is a jQuery plugin designed to toggle the visibility of
webpage elements.

==================================================================
Usage
==================================================================

Call "jlvisi()" on any object that can have a rel attribute.
The rel attribute holds a delimited list of objects to toggle
visibility. Each object in the list is preceded by a symbol which
indicates the visibility state of the object. For example, the hide
indicator is the ! exclamation point and the show indicator is the
* asterisk.

==================================================================
Example
==================================================================

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="jquery.jlvisi.js"></script>

<script type="text/javascript">
	jQuery(document).ready(function () {
    $('#visibility').jlvisi();
});
</script>
<span id="visibility" rel="!#test-1,*.test-2"></span>

<p class="test-1" id="test-1">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. </p>

<p class="test-2" style="display: none;" id="test-2">Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>

<p>This example hides the first paragraph and shows the second.</p>

==================================================================
Options And Defaults
==================================================================

delimitor : ','

== The character used as the list delimiter in the rel attribute		     
             
hide_indicator : '!',

== The character used to indicate if an object should be hidden

show_indicator : '*'

== The character used to indicate if an object should be visible

About

jlVisi is a jQuery plugin designed to toggle the visibility of webpage elements.


Languages

Language:JavaScript 100.0%