showhide

showhide()

This function is now deprecated and will soon be removed please use jQuery Toggle

This function is a simple toggle to switch between hiden and shown states typically applies to html div’s, by default this function uses the jQuery ’slow’ animation.

Usage

1
$('#target_div_id').showhide();

The above will show the div if it is hidden with a css style of ‘display: none’, and hide the div if it is shown with a css style ‘display: block’.

Example


This is the div that will be toggled using showhide()

showhide()

Example Source

1
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script> <script src="http://svn.saiweb.co.uk/branches/jquery_plugin/tags/0.3/jquery.saiweb.min.js" type="text/javascript"></script>
This is the div that will be toggled using showhide()

showhide()

Advanced

1
$('#target_div_id').showhide({anim: 'slow'});

The anim, param specifies the animation, you can use any jQuery compatible animation or none at all i.e.

1
2
3
$('#target_div_id').showhide({anim: 'slow'});
$('#target_div_id').showhide({anim: 'fast'});
$('#target_div_id').showhide({anim: ''});
Leave a Reply

Creative Commons License