Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
- <script language="javascript" type="text/javascript">
- var hideTest = {
- hidePara: function() {
- if ( $(this).is(':checked') ) {
- $('p#hideMe').slideDown('slow');
- } else {
- $('p#hideMe').slideUp('slow');
- }
- },
- setup: function() {
- $('#check').change(hideTest.hidePara);
- }
- };
- $(hideTest.setup);
- </script>
- </head>
- <body>
- <input type="checkbox" id="check" checked="checked"/>
- <label for="check" id="checkLabel">Show Details</label>
- <p id="hideMe">I'm a paragraph of details.</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement