Home Web Front-end JS Tutorial Scroll up and down the page to change the positioning of the top navigation

Scroll up and down the page to change the positioning of the top navigation

Jul 22, 2017 am 09:22 AM
up and down slide top

Recently I encountered a design effect requirement from a designer, which has also been implemented on other websites:

state1: When the web page is scrolled down, the page header bar disappears , the top nav moves up;

state2: When the web page scrolls up, the page header bar appears, and the top nav moves down along the nav.

The page already contains the following functions:

1. When the pop-up window pops up, the pop-up window layer can be scrolled, but the page layer does not allow scrolling. At this time, the overflow style attributes of the body element and html element in the page are set to hidden;

The page structure is as follows:

Header

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if my mobile phone screen is hard to slide and dry? What should I do if my mobile phone screen is hard to slide and dry? Dec 04, 2023 pm 03:51 PM

Solutions for mobile phone screens that are difficult to slide and dry: 1. Humidify the screen; 2. Clean the screen regularly; 3. Increase the sliding strength of your fingers; 4. Use mobile phone screen protectors; 5. Replace protective covers; 6. Keep hands moist; 7. , handle it cleanly when applying the film; 8. Use lubricant; 9. Use gloves; 10. Adjust the screen brightness; 11. Replace the mobile phone. Detailed introduction: 1. Humidify the screen, place a humidifier next to the screen or spray some water to increase the humidity in the air, thereby reducing the dryness of the screen; 2. Clean the screen regularly, use professional screen cleaner, etc.

How to use JavaScript to achieve the up and down sliding switching effect of images and add fade-in and fade-out animations? How to use JavaScript to achieve the up and down sliding switching effect of images and add fade-in and fade-out animations? Oct 20, 2023 am 11:19 AM

How can JavaScript achieve the up and down sliding switching effect of images and add fade-in and fade-out animations? In web development, it is often necessary to achieve image switching effects. You can use JavaScript to achieve up and down sliding switching, and add fade-in and fade-out animation effects. Let’s take a closer look. First, we need a container that contains multiple images. We can use div tags in HTML to host images. For example, we create a div with the id "image-container" to

How to use JavaScript to achieve the effect of dragging up and down images? How to use JavaScript to achieve the effect of dragging up and down images? Oct 18, 2023 am 09:09 AM

How does JavaScript achieve the effect of dragging up and down images? With the development of the Internet, pictures play an important role in our lives and work. In order to improve the user experience, we often need to add some special effects or interactive effects to pictures. Among them, the effect of dragging up and down pictures to switch is a very common, simple and practical effect. This article will introduce how to use JavaScript to achieve this effect and provide specific code examples. First, we need to create an HTML file to display images and implement dragging

HTML, CSS, and jQuery: A technical guide to implementing a sliding panel effect HTML, CSS, and jQuery: A technical guide to implementing a sliding panel effect Oct 27, 2023 pm 04:39 PM

HTML, CSS, and jQuery: Technical Guidelines for Implementing Sliding Panel Effects With the popularity of mobile devices and the development of web applications, sliding panels, as a popular interaction method, are becoming more and more common in web design. By implementing the sliding panel effect, we can display more content in a limited space and improve the user experience. This article will introduce in detail how to use HTML, CSS and jQuery to achieve the sliding panel effect, and provide specific code examples. HTML Structure First, we need to create a basic

Interpretation of jQuery sliding events: implementation principles and precautions Interpretation of jQuery sliding events: implementation principles and precautions Feb 27, 2024 am 10:57 AM

Interpretation of jQuery sliding events: Implementation principles and precautions In front-end development, sliding events are one of the common and commonly used interactive operations. Through sliding events, we can implement functions such as switching carousels and scrolling loading of pages. As a popular JavaScript library, jQuery provides a wealth of sliding event processing methods to facilitate us to achieve various interactive effects. This article will delve into the implementation principles and precautions of sliding events in jQuery, and provide specific code examples. 1. Implementation principle

How to implement sliding in react How to implement sliding in react Dec 30, 2022 am 11:09 AM

The method to implement sliding in react: 1. Find the touches in the onTouchStart event and record the new touch occurrence according to the identifier; 2. Record the coordinates of each point passed by the touch according to the identifier in the onTouchMove event; 3. In the onTouchEnd event, find The finished touch event, and then calculate the gesture to be performed based on the point crossed by the finished touch event.

How to use Vue to implement a sliding carousel How to use Vue to implement a sliding carousel Nov 07, 2023 pm 12:59 PM

Vue is a popular JavaScript framework that helps us build interactive web applications more easily. Today, we will introduce how to use Vue to create a sliding carousel. We will use VueCLI to create a new Vue project and use Vue's official carousel component to implement the sliding carousel chart. Here are the specific steps: Step 1: Install VueCLI To install VueCLI, you need to install Node.js first. Once you have Node.js installed

watchOS 10.2: How to change your watch face with a swipe watchOS 10.2: How to change your watch face with a swipe Dec 15, 2023 pm 11:15 PM

In watchOS 10.2, you can enable swipe gestures to switch between Apple Watch watch faces more easily, just like you did before in watchOS 9. Read on to find out how it's done. If you're a long-time Apple Watch user, you probably remember a time when you could switch watch faces on the display with a simple swipe gesture. This was the default interaction in watchOS9, but Apple then removed the gesture when it upgraded to watchOS10. Apple changed the interaction because users complained it was too easy to accidentally change watch faces. But for anyone who's never had this problem, Apple just made it harder - it's required before swiping

See all articles