Make My Website Better
mobile menu open icon mobile menu close icon
Contact Us Get a Quote

Header Scrolling Javascript Function

Updated November 21, 2023
~ minute read
Header Scrolling Javascript Function

Content Key

Share this Post :
Get the most out of your marketing
Join over 100,000 of the most intelligent marketers in the universe, and receive marketing news and insights straight to your inbox.
Enter Email to Get Started:
(We will never share your information.)

Header Scrolling Javascript Function

Javascript Function

jQuery(document).ready(function($){
var scroll_pos = 0;
scroll_pos = $(this).scrollTop();
if(scroll_pos > 2) {
$("#top-nav").css('background-color', '#ffffffff');
$("#top-nav ul li a").addClass('top-nav-links');
} else {
$("#top-nav").css('background-color', '#ffffff00');
$("#top-nav ul li a").removeClass('top-nav-links');
}
$(document).scroll(function() {
scroll_pos = $(this).scrollTop();
if(scroll_pos > 2) {
$("#top-nav").css('background-color', '#ffffffff');
$("#top-nav ul li a").addClass('top-nav-links');
} else {
$("#top-nav").css('background-color', '#ffffff00');
$("#top-nav ul li a").removeClass('top-nav-links');
}
});

$( document ).on( ‘click’, ‘.close-popup’, function( event ) {
elementorProFrontend.modules.popup.closePopup( {}, event );
} );

});

Leave a Reply

More Great Posts

Blog

In July 2022, Google shared some surprising new data that revealed approximately 40% of Gen Z shoppers (ages 10-25 and 25% of the U.S. population) now use TikTok and Instagram to discover new products and restaurants, rather than typing keywords into Google Search. This change in search behavior highlights a larger trend in shifting consumer […]
The post The Social Discovery Survival Guide appeared first on American Marketing Association.

Read More »

Digital marketing objectives: How to plan, measure and achieve your marketing goals

Without setting clear marketing objectives, you’re basically directionless – and working to achieve vanity metrics that don’t necessarily help you achieve your overall business goals Digital marketing objectives underpin all marketing strategies. After all, how do you know what you’re …..
The post Digital marketing objectives: How to plan, measure and achieve your marketing goals appeared first on Smart Insights.

Read More »
Advertise with us
Join our advertising network to grow your business. Give us a call at (702) 904-4262
34.99 WordPress Updates | WordPress Support by 702 Pros
Sponsored
Build your Rank Ad 1 - RankLabel
Sponsored
Kyla Sloan | Kyla Estes | Client Management | Reception | Sales
Advertising with Us
Kyla SloanAdvertising Specialist
Our team has the digital and traditional marketing skills to get you in front of customers looking for your product or service.
Want to talk now? Give us a call at (702) 904-4262

Powered by OnSago

Add Your Business To the 702 Pros' Directory
Please add some general information about your business.
Want to talk now? Give us a call at (702) 904-4262

Powered by OnSago

2022 Sale

Get 20% off!

All Web Design Packages
Days
Hours
Minutes
Seconds
Want to talk now? Give us a call at (702) 904-4262

Powered by OnSago