Template:UIUCJavascript
From 2013.igem.org
(Difference between revisions)
Line 3: | Line 3: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | (function() { | + | (function() { |
if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {}; | if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {}; | ||
Line 136: | Line 136: | ||
Spry.Widget.Accordion.prototype.closePanel = function() | Spry.Widget.Accordion.prototype.closePanel = function() | ||
{ | { | ||
- | |||
- | |||
- | |||
- | |||
if (!this.useFixedPanelHeights && this.currentPanel) | if (!this.useFixedPanelHeights && this.currentPanel) | ||
Line 288: | Line 284: | ||
this.removeClassName(panel, this.closedClass); | this.removeClassName(panel, this.closedClass); | ||
this.addClassName(panel, this.openClass); | this.addClassName(panel, this.openClass); | ||
- | |||
- | |||
- | |||
- | |||
if (content) | if (content) | ||
Line 297: | Line 289: | ||
if (this.useFixedPanelHeights) | if (this.useFixedPanelHeights) | ||
{ | { | ||
- | + | ||
- | + | ||
if (this.fixedPanelHeight) | if (this.fixedPanelHeight) | ||
Line 305: | Line 296: | ||
else | else | ||
{ | { | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
content.style.height = "auto"; | content.style.height = "auto"; | ||
} | } | ||
Line 333: | Line 321: | ||
for (var i = 0; i < panels.length; i++) | for (var i = 0; i < panels.length; i++) | ||
this.initPanel(panels[i], i == this.defaultPanel); | this.initPanel(panels[i], i == this.defaultPanel); | ||
- | |||
- | |||
- | |||
this.enableKeyboardNavigation = (this.enableKeyboardNavigation && this.element.attributes.getNamedItem("tabindex")); | this.enableKeyboardNavigation = (this.enableKeyboardNavigation && this.element.attributes.getNamedItem("tabindex")); | ||
Line 411: | Line 396: | ||
this.element.blur(); | this.element.blur(); | ||
}; | }; | ||
- | |||
- | |||
Spry.Widget.Accordion.PanelAnimator = function(accordion, panel, opts) | Spry.Widget.Accordion.PanelAnimator = function(accordion, panel, opts) | ||
Line 534: | Line 517: | ||
}; | }; | ||
- | })(); | + | })(); |
</script> | </script> | ||
</head> | </head> | ||
</html> | </html> |
Revision as of 17:15, 1 September 2013