This is what came to mind though there could be some easy implementations as well:
jQuery(document).ready(function(){
jQuery(document).scroll(function(){
if(jQuery(document).scrollTop()>0){
jQuery('#first-header').hide();
jQuery('#second-header').show();
}
else{
jQuery('#second-header').hide();
jQuery('#first-header').show();
}
})
})
Related Posts:
- How to get the browser to navigate to URL in JavaScript
- Add infinite scroll to content splitted post
- Inserting ads within content
- remove inline scripts from the_content() produced by plugins?
- Script to Automatically Advance to the Next Page of a Paginated Post
- WordPress Guternberg Content For React Native
- Failed to load resource: the server responded with a status of 404 (Not Found)
- How to add a class to a given element?
- What is NODE_ENV and how to use it in Express?
- How to deal with net::ERR_SSL_PROTOCOL_ERROR?
- What is the way of declaring an array in JavaScript?
- How to disable JavaScript in Chrome Developer Tools?
- Reactjs – Form input validation
- What is event bubbling and capturing?
- What is lexical scope?
- Remove element by id
- await is only valid in async function
- Remove duplicate values from JS array [duplicate]
- How to read an external local JSON file in JavaScript?
- Angular: mat-form-field must contain a MatFormFieldControl
- JS – ReferenceError: fetch is not defined
- Check if a variable is a string in JavaScript
- How can I add a key/value pair to a JavaScript object?
- Adding an onclick event to a div element
- Typescript : Property does not exist on type ‘object’
- How to check if array is empty or does not exist?
- What is the difference between document.location.href and document.location?
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Preloading images with JavaScript
- How to print elements from array with javascript
- What is the JavaScript version of sleep()?
- How do I scroll to an element using JavaScript?
- Finding largest integer in an array in JavaScript
- javascript set cookie with expire time
- Angular: conditional class with *ngClass
- How can I add a key/value pair to a JavaScript object?
- How to loop through an array containing objects and access their properties
- Expected linebreaks to be ‘LF’ but found ‘CRLF’ linebreak-style
- Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
- TypeError: Invalid attempt to spread non-iterable instance
- Declaring multiple variables in JavaScript
- How to print a number with commas as thousands separators in JavaScript
- Convert Array to Object
- CSS Animation onClick
- Partial render in HTML/JavaScript
- How can I check if a string is a valid number?
- Javascript setInterval not working
- Set value to currency in
- How to add 30 minutes to a JavaScript Date object?
- How to execute a function when page has fully loaded?
- Is there a “not in” operator in JavaScript for checking object properties?
- How to add a keyboard listener to my onClick handler?
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- HTML Entity Decode
- what is ScriptResource.axd in the page load in web app?
- {“error”: “Please use POST request”} – alternative solution to submitting a form
- Get JavaScript object from array of objects by value of property [duplicate]
- Simple pagination in javascript
- Javascript swap array elements
- jQuery sort elements using data id
- Resource interpreted as Document but transferred with MIME type application/zip
- How to redirect to another page using AngularJS?
- events.js: 141 throw er; // Unhandled ‘error’ event
- How to fire an event on class change using jQuery?
- JavaScript code to stop form submission
- What do these three dots in React do?
- Change an image with onclick()
- Cannot read property ‘preventDefault’ of undefined in javascript error
- Javascript callback function throws error “Callback is not a function” in firefox
- How can I stop the browser back button using JavaScript?
- JavaScript isset() equivalent
- $http.get(…).success is not a function
- How to use wordpress default Password Strength Meter script
- wp_enqueue_script() not working at all
- WordPress 5.5 – ReferenceError: commonL10n is not defined error
- Script to run at completion of Page Loading
- Documentation for IDE’s
- Cloudflare’s Rocket Loader + WordPress -> Ignore scripts?
- Get HTTP response code on non-2xx apiFetch request
- Add custom HTML markup to Gutenberg RichText
- Enqueue scripts all over but not in single.php
- why code javascript ,not repeat the loop main wordpress
- Adding code to head to all pages manually
- Javascript on Registration Page
- How to modify the paths of js from twentytwelve theme?
- Gutenberg dependencies in package.json
- Homepage js is conflicting with js of plugin of other page
- How to display/hide accordion? [closed]
- Unable to remove meta box from custom post for all non admin users
- How to import a JavaScript Library into WordPress
- How to get file object from file_attachment?
- How to change the link address from internal to external
- How do I load urls from an external .js file to my admin head?
- Uncaught TypeError: Cannot read property ‘add’ of undefined bp-plupload.min.js
- Where is the Javascript attribute window._wpCustomHeaderSettings defined?
- how to include js in widget?
- JS files landing on page but not working, using childtheme of twentyeleven
- List unused javascript for easy removal
- Include Facebook Javascript SDK In WordPress
- Use add_action to run a script, but only on the post editor page