Skip to content

JQuery Plugin - adds (& deletes) a remote snippet of HTML on clicking a link

Notifications You must be signed in to change notification settings

ocean-internet/toggleLoad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

********************************************************************************
* toggleLoad.js - Jquery Plugin                                                *
********************************************************************************

JQuery Plugin - adds (& deletes) a remote snippet of HTML on clicking a link


********************************************************************************
* Options                                                                      *
********************************************************************************

attr:            'href',
data:            null,
addLinkClass:    'add',
addLinkHtml:     '+',
removeLinkClass: 'remove',
removeLinkHtml:  '-',
addElement:      '<div class="clearfix" />',
addElementClass: 'toggleLoad',
elementAdded:    function (element) { $(element).effect('highlight'); },
elementRemoved:  function (parent)  { $(parent) .effect('highlight'); }


********************************************************************************
* Usage                                                                        *
********************************************************************************

<ol>
	<li class="menu"><a href="/subMenu1.html" class="add">+</a>&nbsp;Top</li>
	<li class="menu"><a href="/subMenu2.html" class="add">+</a>&nbsp;Menu</li>
	<li class="menu"><a href="/subMenu3.html" class="add">+</a>&nbsp;Level</li>
</ol>
<script>
$(function () {
	$('.menu .add').toggleLoad();
});
</script>


********************************************************************************
* Todo                                                                         *
********************************************************************************

@todo add unit tests
@todo add docs

About

JQuery Plugin - adds (& deletes) a remote snippet of HTML on clicking a link

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published