Changeset - 00b0576bbb2f
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 7 years ago 2014-12-01 18:38:08
bkuhn@ebb.org
Add show/hide javascript as used for npoacct.
1 file changed with 31 insertions and 0 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/supporter/index.html
Show inline comments
...
 
@@ -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 %}
 

	
0 comments (0 inline, 0 general)