Skip to content

Instantly share code, notes, and snippets.

@cjpetrus
Last active September 6, 2017 07:58
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 cjpetrus/cd35a7b91cabc8eebd1b1f9ff28c2ef4 to your computer and use it in GitHub Desktop.
Save cjpetrus/cd35a7b91cabc8eebd1b1f9ff28c2ef4 to your computer and use it in GitHub Desktop.
This is a hack to always allow the menu to reach the nav item regardless of screen dimensions (responsive). (PerfectCSV WP theme)
(function($){
"use strict";
$(document).ready(function($) {
var cur_width = $(window).width();
if (cur_width < 940) {
$(".site_nav").css({
"position":"relative",
"margin-bottom": "0",
"width": "100%",
});
}
$(window).scroll(function() {
var pos = $(window).scrollTop();
var cur_width = $(window).width();
if (cur_width < 940) {
$(".site_nav").css({
"position":"relative",
"margin-bottom": "0",
"width": "100%",
});
}
});
});
// position: relative;
// margin-bottom: 0px;
// width: 100%;
// top: 0px;
})(jQuery);
@cjpetrus
Copy link
Author

cjpetrus commented Apr 3, 2016

This is a hack to always allow the menu to reach the nav item regardless of screen dimensions (responsive).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment