Last active
August 29, 2015 14:16
-
-
Save TimothyClayton/db97648af22c5d228870 to your computer and use it in GitHub Desktop.
Easy expand/collapse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#expand-collapse-all | |
= image_tag('expand_all.png', id: 'expand-all', onclick: 'showAll()') | |
= image_tag('collapse_all.png', id: 'collapse-all', onclick: 'hideAll()') | |
.things-to-hide-or-show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.things-to-hide-or-show, #collapse-all { | |
display:none; | |
} | |
#expand-collapse-all { | |
cursor:pointer; | |
text-align:center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showAll() { | |
$('#expand-all').hide(); | |
$('.things-to-hide-or-show, #collapse-all').show(); | |
} | |
function hideAll() { | |
$('#collapse-all, .things-to-hide-or-show').hide(); | |
$('#expand-all').show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment