Skip to content

Instantly share code, notes, and snippets.

@Saturate
Last active December 11, 2015 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Saturate/4643096 to your computer and use it in GitHub Desktop.
Save Saturate/4643096 to your computer and use it in GitHub Desktop.
function toggleHeader(e) {
$('.header-user-info')
.css({opacity: 0.0, visibility: "visible"})
.animate({marginTop: '0px', opacity: 1.0}, 500);
$('.header-close-user-info')
.css({opacity: 0.0, visibility: "visible", display: "inline-block"})
.animate({opacity: 1.0}, 500);
$('.overlay')
.css({opacity: 0.0, visibility: "visible"})
.animate({opacity: 0.7}, 500);
$('.header-right').delay(200).queue(function(){
$(this).addClass("header-right-pushed").dequeue();
});
$('.header-open-user-info').off('click', toggleHeader);
$('.input').focus();
}
function updateUI() {
var element = '.content-left, .content-right';
var elementRemoveHeight = 81;
$(element).css('height', $(window).height() - elementRemoveHeight);
}
$(function(){
$('.poplink').tipsy({fade: true, gravity: 's'}); // nw | n | ne | w | e | sw | s | se
// NanoScroll needs this a second time to work.
$(document).ready(function() {
$('.nano').nanoScroller({
preventPageScrolling: true
});
});
$('.header-open-user-info').on('click', toggleHeader);
$('.header-close-user-info, .overlay').on('click', function() {
$('.header-user-info')
.css({opacity: 1.0, visibility: "visible"})
.animate({marginTop: '-170px', opacity: 0.0}, 250);
$('.header-close-user-info')
.css({opacity: 1.0, visibility: "visible", display: "none"})
.animate({opacity: 0.0}, 300);
$('.overlay')
.css({opacity: 0.7, visibility: "hidden"});
$('.header-right').delay(170).queue(function(){
$(this).removeClass("header-right-pushed").dequeue();
});
$('.header-open-user-info').on('click', toggleHeader);
});
$(window).resize(updateUI);
updateUI();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment