Community Forums › Forums › Archived Forums › Design Tips and Tricks › Modify theme js (window height):
Tagged: javascript, jquery
- This topic has 4 replies, 2 voices, and was last updated 9 years, 8 months ago by jgk.
-
AuthorPosts
-
January 24, 2015 at 3:13 pm #138548jgkMember
Hello!
For the theme below, the .front-page-header height is being modified with the below bit of javascript.
I would like to modify this javascript so that the bottom of ".front-page-header" hits exactly the bottom of the window, rather than hitting a little above it.
Please help!
Thank you!
http://osof.studioissa.com/jQuery(function( $ ){ // Header Height var navHeight = $('.nav-primary').outerHeight(); var snavHeight = $('.nav-secondary').outerHeight(); var beforeheaderHeight = $('.before-header').outerHeight(); var windowHeight = $(window).height(); var newHeight = windowHeight - navHeight - snavHeight - beforeheaderHeight; $('.front-page-header') .css({'height': newHeight +'px'}); $('.image-section') .css({'height': windowHeight +'px'}); $(window).resize(function(){ var navHeight = $('.nav-primary').outerHeight(); var snavHeight = $('.nav-secondary').outerHeight(); var beforeheaderHeight = $('.before-header').outerHeight(); var windowHeight = $(window).height(); var newHeight = windowHeight - navHeight - snavHeight - beforeheaderHeight; $('.front-page-header') .css({'height': newHeight +'px'}); $('.image-section') .css({'height': windowHeight +'px'}); });
January 24, 2015 at 6:17 pm #138557Jeremy HoldenParticipantI don't see the classes you have in your js at all on the site so I don't really know what you're trying to do.
Jeremy
Website design and Genesis customization
jeremyholden.meJanuary 25, 2015 at 10:24 am #138590jgkMemberHi Jeremy, Thank you, I'm trying to make ".front-page-header" like 15% bigger vertically. Here's the site: http://osof.studioissa.com/
January 25, 2015 at 2:20 pm #138605jgkMemberWhoops, I was pasting the incorrect java script. here it is:
jQuery(function( $ ){ $('.site-header').addClass('front-page-header'); $('.footer-widgets').prop('id', 'footer-widgets'); $(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu").addClass("responsive-menu").before('<div class="responsive-menu-icon"></div>'); $(".responsive-menu-icon").click(function(){ $(this).next(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu").slideToggle(); }); $(window).resize(function(){ if(window.innerWidth > 800) { $(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu, nav .sub-menu").removeAttr("style"); $(".responsive-menu > .menu-item").removeClass("menu-open"); } }); $(".responsive-menu > .menu-item").click(function(event){ if (event.target !== this) return; $(this).find(".sub-menu:first").slideToggle(function() { $(this).parent().toggleClass("menu-open"); }); }); // Local Scroll Speed $.localScroll({ duration: 750 }); // Sticky Navigation var headerHeight = $('.site-header').innerHeight(); var beforeheaderHeight = $('.before-header').outerHeight(); var abovenavHeight = headerHeight + beforeheaderHeight - 1; $(window).scroll(function(){ if ($(document).scrollTop() > abovenavHeight){ $('.nav-primary').addClass('fixed'); } else { $('.nav-primary').removeClass('fixed'); } }); });
January 25, 2015 at 2:33 pm #138606jgkMemberHey Jeremy, Thanks for the help, but don't worry about it: I'm disabling the javascript and fixing it w/ css.
Thanks,
Jay
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.