Created
September 21, 2013 05:11
-
-
Save patrickkettner/6647422 to your computer and use it in GitHub Desktop.
codepen zoomer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $results = $('#result_div'); | |
var button = document.createElement('button'); | |
button.className = 'top-button button'; | |
button.innerHTML = 'Zoom'; | |
var toggleZoom = function() { | |
var result_height = $results.attr('data-height'); | |
$('.top-boxes, .resizer').toggle(); | |
if (result_height) { | |
$results.height(result_height); | |
$results.removeAttr('data-height'); | |
} | |
else { | |
$results.attr('data-height', $results.height()); | |
$results.height('100%'); | |
} | |
}; | |
button.onclick = toggleZoom; | |
$('.box-actions').append(button); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment