Skip to content

Commit

Permalink
Close academicpages#2637 toggle the wrapper on resize
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzupkoii committed Dec 15, 2024
1 parent a932981 commit 4b94adc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
========================================================================== */

$(document).ready(function(){
// These should be the same as the settings in _variables.scss
scssLarge = 925; // pixels

// Sticky footer
var bumpIt = function() {
$("body").css("margin-bottom", $(".page__footer").outerHeight(true));
Expand Down Expand Up @@ -30,6 +33,13 @@ $(document).ready(function(){
$(".author__urls-wrapper button").toggleClass("open");
});

// Restore the follow menu if toggled on a window resize
jQuery(window).on('resize', function() {
if ($('.author__urls.social-icons').css('display') == 'none' && $(window).width() >= scssLarge) {
$(".author__urls").css('display', 'block')
}
});

// init smooth scroll, this needs to be slightly more than then fixed masthead height
$("a").smoothScroll({offset: -65});

Expand Down
2 changes: 1 addition & 1 deletion assets/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit 4b94adc

Please sign in to comment.