diff --git a/static/script.js b/static/script.js index c37929e64734447d74ecc977d7583fd385f8a1f1..3fe38969aa699ff7457cb4c31071712da818e1f3 100644 --- a/static/script.js +++ b/static/script.js @@ -1,19 +1,18 @@ $(function() { $('.component-demos .icon-all').on('click', function() { - //if ($(this).hasClass('expand')) { - // $(this).removeClass('expand'); - // $('.code-box .highlight').animate({ - // height: 'hide', - // opacity: 0 - // }, 150); - //} else { - // $(this).addClass('expand'); - // $('.code-box .highlight').animate({ - // height: 'show', - // opacity: 1 - // }, 150); - //} - $('.code-box .highlight').slideToggle(150); + if ($(this).hasClass('expand')) { + $(this).removeClass('expand'); + $('.code-box .highlight').animate({ + height: 'hide', + opacity: 0 + }, 150); + } else { + $(this).addClass('expand'); + $('.code-box .highlight').animate({ + height: 'show', + opacity: 1 + }, 150); + } }); $('.code-box').each(function(i, item) { @@ -22,11 +21,10 @@ $(function() { }); $('.code-boxes').on('click', '.collapse', function() { - //$(this).parent().parent().find('.highlight').animate({ - // height: 'toggle', - // opacity: 'toggle' - //}, 150); - $(this).parent().parent().find('.highlight').slideToggle(150); + $(this).parent().parent().find('.highlight').animate({ + height: 'toggle', + opacity: 'toggle' + }, 150); }); var navFunc = {