Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Responsive Navigation
- var nava = jQuery(".nav-btn"),
- navb = jQuery("#navigation"),
- wind = jQuery(window).width(),
- winh;
- if(wind < 1009) {
- winh = jQuery(window).outerHeight()
- }
- else {
- winh = jQuery(window).outerHeight() -jQuery('#header').outerHeight()
- }
- // Add classes
- jQuery(window).resize(function () {
- var nava = jQuery(".nav-btn"),
- navb = jQuery("#navigation"),
- wind = jQuery(window).width(),
- winh;
- if(wind < 1009) {
- winh = jQuery(window).outerHeight()
- }
- else {
- winh = jQuery(window).outerHeight() -jQuery('#header').outerHeight()
- }
- if (wind > 1008) {
- navb.addClass("desktop");
- navb.removeClass("mobile")
- }
- if (wind < 1009) {
- navb.addClass("mobile");
- navb.removeClass("desktop")
- }
- // Nav CSS adjustment for mobile
- if (wind < 1009) {
- jQuery('#navigation.mobile').css({'max-height': winh-150, 'overflow-y': 'scroll'});
- }
- if (wind > 1008) {
- jQuery('#navigation.desktop').css({'overflow': 'visible'});
- }
- });
- if (wind > 1008) {
- navb.addClass("desktop");
- navb.removeClass("mobile")
- }
- if (wind < 1009) {
- navb.addClass("mobile");
- navb.removeClass("desktop")
- }
- // Nav CSS adjustment for mobile
- if (wind < 1009) {
- jQuery('#navigation.mobile').css({'max-height': winh-150, 'overflow-y': 'scroll'});
- }
- if (wind > 1008) {
- jQuery('#navigation.desktop').css({'overflow': 'visible'});
- }
- // Click Tweak
- nava.click(function () {
- if (navb.is(":visible")) {
- navb.slideUp()
- } else {
- navb.slideDown()
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement