Browsing projects by Tag(s)

Select a tag to browse associated projects and drill deeper into the tag cloud.

Showing page 1 of 1

jquery-showhideA robust "toggle" plugin for jQuery. Features include the use of cookies, toggling of text and more. Remember the state of the target object in a cookie. Change the text of the toggle element (useful if you want the link text to change, e.g. "Show ... [More] form"/"Hide form"). Apply classes to the toggle element to give it plus/minus classes. Auto focus on a form element within the target element (useful if you are showing a hidden form). To see what you can do with this plugin, check out this short video (no audio) of a (very) simple example usage: This shows the showhide functionality as well as the "autofocusing" of the first text field in the form. Very useful if you have hidden forms in your page and you want to quickly enter content. You can also check out the blog post on jquery-showhide here: http://www.danawoodman.com/2009/11/introducing-jquery-showhide/ Check out some examples below to get started. Example 1A simple inline toggle using no options. By default showhide will toggle the next element (e.g. $(this).next()) and will default the target object to be visible. First add in the jQuery code to the of the page: $(function() { $('#example-1').showhide(); }); ... then add in the HTML: Toggle This can be toggled. The link tag is what we call the toggle element and the span tag is what we call the target element. The last thing that you will have to do is add in some styling for the "hidden" class (by default, a class of "hidden" is applied to the target element.) .hide { display: none; } This example will have the link toggle the visibility of the element. Now, of course this is not very interesting or useful but by using the available settings you can control a variety of functionality. Example 2This example is useful if you need to toggle elements that are not directly next to each other. This reference the toggle object (this) within the functions settings, making it easy to The JavaScript: $(function() { $('#example-2').showhide({ target_obj: '$(this).parent().next()'; }); }); The HTML: Toggle This can be toggled. For more information, check out the "demo" folder. I will be updating the docs and providing more examples when I have time :) If you would like to contribe to this project, please email me at wooman.dana at gmail.com. If you find a bug, please submit it using the "Issues" tab above. Thanks for visiting! [Less]

0
 
  0 reviews  |  0 users  |  489 lines of code  |  0 current contributors  |  Analyzed 7 days ago
 
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.