Add show/hide javascript as used for npoacct.
This commit is contained in:
parent
7276f0e17c
commit
00b0576bbb
1 changed files with 31 additions and 0 deletions
|
@ -6,6 +6,37 @@
|
|||
<link href="/jquery-ui.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.toggle-content').hide();
|
||||
|
||||
$('.toggle-control')
|
||||
.addClass('clickable')
|
||||
.bind('click', function() {
|
||||
var $control = $(this);
|
||||
var $parent = $control.parents('.toggle-unit');
|
||||
|
||||
$parent.toggleClass('expanded');
|
||||
$parent.find('.toggle-content').slideToggle();
|
||||
|
||||
// if control has HTML5 data attributes, use to update text
|
||||
if ($parent.hasClass('expanded')) {
|
||||
$control.html($control.attr('data-expanded-text'));
|
||||
} else {
|
||||
$control.html($control.attr('data-text'));
|
||||
}
|
||||
});
|
||||
$('a.donate-now')
|
||||
.addClass('clickable')
|
||||
.bind('click', function() {
|
||||
var $control = $('#donate-box');
|
||||
|
||||
$control.toggleClass('expanded');
|
||||
$control.find('.toggle-content').slideUp("slow");
|
||||
$control.find('.toggle-content').slideDown("slow");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue