"Header becomes frozen in place while scrolling, never budging from

I am looking to implement a sticky header effect on scroll, similar to the example shown here: () Check out the source site for more details: (https://github.com/davist11/jQuery-Stickem)

Currently, I have a full-screen video playing at the top of the page and I want the header to stick when the page is scrolled and it reaches the video. Additionally, there is a small border at the top of other pages that I want the scroll to bypass until it reaches this point and then stick.

To see what it looks like currently, click on this link: http://jsfiddle.net/wp7ornmv/

EDIT: Make sure to scroll in the HTML window

<div id="logo">
    </div>
    <div id="intro">

        <video autoplay loop poster="images/work/bluesky.jpg" id="bgvid">
            <source src="video/Peri_CloudLoop_BlueTV.webm" type="video/webm">
            <source src="video/Peri_CloudLoop_BlueTV_3.mp4" type="video/mp4">
        </video>
    </div>
    <div id="container">
        <div id="content">
            <div id="Mbackground">
                <div id="Ncontainer">
                    <div id="Ncontain">

                        <div id="Nlogo">Logo
                        </div>
                        <div id="Nmenu">
                            <div class="Nlink"><a href="url">Contact</a>
                            </div>
                            <div class="Nlink"><a href="url">About</a>
                            </div>
                            <div class="Nlink"><a href="index.html" class="active transition">Work</a>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
            <div id="Mbackground">
                <div id="Mbody">
                <div class="Mrow">
                    <div class="Mcontainer">
                        <a href="project.html" class="transition">
                            <span class="link-spanner"></span>
                        </a>
                        <div id="Mimageone" class="Mimage">
                        </div>
                        <div id="Mborderone" class="Mborder">
                        </div>
                        <div id="Mboxone" class="Mbox">
                            <div class="Mtext">
                                <div class="Mtitle">Title
                                </div>
                                <div class="Msubtitle">Subtitle
                                </div>
                                <div class="Mdescrip">Descript
                                </div>
                            </div>
                            <div class="Meye">
                            </div>
                        </div>
                    </div>
            </div>

        </div>
    </div>
    <div id="footer">
        <div id="footerhalf1">
        </div>
        <div id="footerhalf2">  
            <div id="footercontents">Made by
            </div>
        </div>

    </div>

Answer №1

This unique behavior is made possible with JavaScript using stickem. For more information, you can visit the project's repository HERE

To implement this, ensure that your container has a position relative and your sidebar has a position:fixed; top:0; left:auto.

This method is commonly used on websites that display advertisements on a side panel. There are detailed resources available online for further information. By utilizing the demo provided and the stickem jQuery library, you can easily achieve this effect.

Best of luck with your implementation!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the method for sending a CSV file as Form Data through a REST API?

I am currently struggling with encoding my uploaded CSV file to Form Data. My approach is to pass the actual file to be processed on the backend using the post method of my API. However, I keep encountering an error message saying "TypeError: Failed to con ...

Using a Javascript plugin in Laravel with Vue by importing it into the project

Currently, I am in the process of creating a Vue component by utilizing the functionalities provided by the JavaScript plugin known as Cropper JS. The application is developed using Laravel 5.6. Initially, I installed Cropper JS via NPM: npm install cropp ...

"Troubleshooting: jQuery Find function not functioning correctly with HTML template

I am having trouble with a Shopify liquid code that I am trying to load into an HTML template <script type="text/template" id="description"> <div class="product-ddd"> {{ product.description }} </div> ...

What is the best way to display circles (generated from JSON data) in reverse order by incorporating a delay function?

I am currently working on creating an interactive visualization using circles that expand over a specified period, all centered at the same point. I have a script that generates these circles and saves the data in a JSON file. The smallest circle is posit ...

What could be causing my ng-grid footer to refuse to align with the bottom border?

Currently utilizing ng-grid and various AngularJS UI Bootstrap components on my website, I have encountered a recurring issue. By diligently investigating, I have successfully replicated the problem. Access the Plunker demonstration through this link. The ...

Struggling with inserting a fresh form into every additional <div> section

During my quest to develop a To-Do list application, I encountered a new challenge. In my current implementation, every time a user clicks on New Category, a new div is supposed to appear with a custom name and a specific number of forms. However, an issu ...

Modify the button text when it is hovered over

I am attempting to modify the text displayed on a button when hovering over it in a React component from Ant Design. However, I have not been successful so far. Button <div className={ status == "verified" ? `${styles.btn1} ${styles.btn1C ...

"Utilize Bootstrap 4 to align text in the center and expand the text area for a

Currently experiencing some challenges with Bootstrap 4: Need to center the inline input fields Insert space between the inputs Add a large textarea below the input fields This is the current layout: Here is the HTML code: body { background: url(h ...

The component triggering the redirect prematurely, interrupting the completion of useEffect

I set up a useEffect to fetch data from an endpoint, and based on the response, I want to decide whether to display my component or redirect to another page. The problem I'm facing is that the code continues to run before my useEffect completes, lead ...

Tips for managing the width of tr:nth-child(odd)

I am in search of a way to style my datasheets using tr:nth-child(odd). Below is the code snippet I am currently using: My main concern lies in adjusting the width. I aim for it to occupy a space that measures 200px by 400px The depth does not pose an is ...

What could be the reason for esbuild not being included in the installation process of a fresh Rails 7 application that

After initiating a fresh Rails 7 app, I utilized the command line syntax: $ rails new app_name --css=bootstrap An error occurred during app creation specifically when including --css=bootstrap: Install esbuild run yarn add esbuild from ".& ...

Python Selenium scraping script encountered an issue: Javascript element could not be located

I'm currently practicing my skills in scraping Javascript frontend websites and decided to work on the following site: While attempting to locate two elements using their xPath, I encountered an issue. The first element, the title, I was able to find ...

When combining Symfony, Twig, and Semantic UI, users may encounter an issue where the background image fails to display

Can someone assist me in identifying the issue with my code? I am using Symfony 2.8, Semantic UI, and Twig, attempting to set a background image on my site. The modification is being made to my base.html.twig file. I have attempted: Using different ima ...

Is it possible to create a dynamic zig-zag design with CSS that

I am looking to design a dynamic snake/zigzag layout that consists of square images and circles, starting from the center of the container and descending in a winding fashion. The number of elements is not fixed and is generated based on data received fro ...

What happens when a PHP field is left empty?

I have created 3 PHP files. The first file contains fields to be filled out, similar to an HTML form. The second file takes the data from the first file and saves it in a text file with the title as the date and time. The third file confirms the registrati ...

D3-cloud creates a beautiful mesh of overlapping words

I am encountering an issue while trying to create a keyword cloud using d3 and d3-cloud. The problem I am facing is that the words in the cloud are overlapping, and I cannot figure out the exact reason behind it. I suspect it might be related to the fontSi ...

The canvas element automatically removes itself after being resized within an HTML5/JavaScript environment

I created a canvas that is interactive and responsive to screen size. However, I encountered an issue where the canvas clears itself when the browser is resized by just one pixel. Is there a way to prevent this from happening? I have included code in my sc ...

I'm having trouble figuring out the issue with the HTML code I wrote to include a favicon on my website

Take a look at this code: <link rel = "shortcut icon" type = "image/x-icon" href = "C:/Users/SOMEBODY/Desktop/SOME FOLDER/ANOTHER FOLDER/favicon.ico"/> Even though I have the favicon in the same folder as my website, ...

Vue js: Stop Sorting array items; only display the resulting array

I recently came across a tutorial on voting for a Mayoral Candidate. The tutorial includes a sort function that determines the winner based on votes. However, I noticed that the sort function also rearranges the candidate list in real time, which is not id ...

Convert JSON data into a nested unordered list

I need help converting a JSON object into an unordered list using jQuery. Here's the JSON data I have: var myJSON = "{name:\"Director\",children:[name:\"Exe Director1\",name:\"Exe Director2\",name:\"Exe Director3&bs ...