• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Modify theme js (window height):

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Modify theme js (window height):

This topic is: not resolved

Tagged: javascript, jquery

  • This topic has 4 replies, 2 voices, and was last updated 8 years, 1 month ago by jgk.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • January 24, 2015 at 3:13 pm #138548
    jgk
    Member

    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!

    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'});
    	
    	});
    http://osof.studioissa.com/
    January 24, 2015 at 6:17 pm #138557
    Jeremy Holden
    Participant

    I 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.me

    January 25, 2015 at 10:24 am #138590
    jgk
    Member

    Hi 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 #138605
    jgk
    Member

    Whoops, 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 #138606
    jgk
    Member

    Hey Jeremy, Thanks for the help, but don't worry about it: I'm disabling the javascript and fixing it w/ css.

    Thanks,

    Jay

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble