Team:ETH Zurich/collapsible
From 2013.igem.org
(Difference between revisions)
Line 25: | Line 25: | ||
function CollapsibleContainerTitleOnClick() { | function CollapsibleContainerTitleOnClick() { | ||
// The item clicked is the title div... get this parent (the overall container) and toggle the content within it. | // The item clicked is the title div... get this parent (the overall container) and toggle the content within it. | ||
- | + | $(".collapsibleContainerContent", $(this).parent()).slideToggle(); | |
- | + | strBefore = "collapse"; | |
+ | str = "expand"; | ||
+ | if ($(".collapsibleContainerContent", $(this).parent()).attr('title').indexOf("expand") >= 0) | ||
+ | { | ||
+ | str = [strBefore, strBefore = str][0]; | ||
+ | } | ||
+ | $(".collapsibleContainerContent", $(this).parent()).attr('title', $(".collapsibleContainerContent", $(this).parent()).attr('title').replace(strBefore, str)); | ||
} | } | ||
$(document).ready(function() { | $(document).ready(function() { |
Revision as of 14:55, 25 October 2013