• 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

Agency Pro – Site Header transparency linked to scroll

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 › Agency Pro – Site Header transparency linked to scroll

This topic is: not resolved

Tagged: header, scroll, transparency

  • This topic has 4 replies, 3 voices, and was last updated 9 years, 2 months ago by vagalab.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • August 22, 2016 at 11:42 am #191803
    JeffCl
    Member

    Hey,

    I am using Agency Pro, and I have made my header transparent using rgba colours in the css:

    .site-header {
        background-color: rgba(51, 51, 51, 0.3);
    }

    Which is great...

    However I want the transparency to stop once the user has scrolled up and onto the home middle widget.

    Sort of like the opposite to how the home top widget text fades away.

    As the page scrolls up and the home top widget text fades and the home middle widget comes into view, I'd like the site header to become a solid color fixed top nav bar.

    I hope someone can help.

    Thanks

    Jeff

    http://ezuconsulting.com
    August 22, 2016 at 1:08 pm #191813
    Nettbrygga
    Member

    Hello,

    This should work.

    Add this to home.js:

    $( document ).on('scroll', function(){

    if ( $( document ).scrollTop() > 650 ){
    $( '.site-header' ).addClass( 'dark' );
    }
    else {
    $( '.site-header' ).removeClass( 'dark' );
    }
    });

    CSS:
    .dark {
    background-color: #000 !important;
    }


    Contact me for Genesis and WordPress related issues – inge [@] nettbrygga.no

    August 23, 2016 at 12:41 am #191852
    JeffCl
    Member

    Dear Penguinsuit

    You sir, are a gent. That is very very much appreciated.

    Jeff

    August 23, 2016 at 3:31 pm #191927
    Nettbrygga
    Member

    No problem 🙂


    Contact me for Genesis and WordPress related issues – inge [@] nettbrygga.no

    January 3, 2017 at 6:23 am #198671
    vagalab
    Participant

    Hi,
    I would like to ask where exactly to put code in home.js:

    jQuery(function( $ ){
    
        $.localScroll({
        	duration: 900
        });
        
    	function fade_home_top() {
    		if ( $(window).width() > 800 ) {
    			window_scroll = $(this).scrollTop();
    	   		$( ".home-top" ).css({
    				  'opacity' : 1-(window_scroll/300)
    	    	});
    		} else {
    			$( ".home-top" ).css({
    				'opacity' : 1
    			});
    		}
    	}
    	$(window).scroll(function() { fade_home_top(); });
    
    	//Allow images to work on all mobile devices
    	if ( $(window).width() >= 480 ) {
    		$( ".home-middle .featuredpost a.aligncenter,.home-middle .featuredpost a.alignleft, .home-middle .featuredpost a.alignright, .home-middle .featuredpost a.alignnone").on( "touchend orientationchange", function (e) {
    			"use strict";
    			var link = $(this);
    			if ( link.hasClass( "hover" ) ) {
    				return true;
    			} else {
    				link.addClass( "hover" );
    				$( ".home-middle .featuredpost a.aligncenter,.home-middle .featuredpost a.alignleft, .home-middle .featuredpost a.alignright, .home-middle .featuredpost a.alignnone").not(this).removeClass( "hover" );
    				e.preventDefault();
    				return false; //extra, and to make sure the function has consistent return points
    			}
    		});
    	}
    	
    	//Add Keyboard Accessibility
    	$( ".home-middle .featuredpost .entry *" )
    	.focus( function() {
    		$(this).closest( ".entry" ).addClass( "focused" );
    	})
    	.blur( function() {
    		$(this).closest( ".entry" ).removeClass( "focused" );
    	});
    	
    });
    
    
  • 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

© 2026 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