Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9046511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:40:28+00:00 2026-06-16T11:40:28+00:00

I want a div to appear at the top when user scroll down pass

  • 0

I want a div to appear at the top when user scroll down pass a div class called .header1 (This div has 3 other div inside)

I want the nav to appear in that .fixedDiv. I found my answer here, but I have not been able to implement it on my site.
Here is what I got

<script type="text/javascript">
    var startY = $('.header1').position().top + $('.header1').outerHeight();
    $(window).scroll(function () {
        if( $(this).scrollTop() > startY ){
            $('.fixedDiv').slideDown();
        }else{
            $('.fixedDiv').slideUp();
        }
    });
</script>

And I have a div called .fixedDiv on my site saying topnav, my problem is the div is always there. It doesn’t hide or appear when scrolling down.

This is a link to my website.

For css I have nothing setup for .header1 because other div are inside and they should be the height needed for .fixedDiv to appear. And .fixedDiv has css

.fixedDiv {
    position:fixed;
    top:0px;
    left:0px;
    background:orange;
}

I know I’m close to getting this working but I just can’t seem to figure out what I’m missing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:40:29+00:00Added an answer on June 16, 2026 at 11:40 am

    So finally got it figured out, and I love it, it looks great

    jQuery(document).ready(function() {
    var startY= jQuery('.header1').position().top + jQuery('.header1').outerHeight();
    jQuery('.fixedDiv').html( jQuery('#nav').html());
    jQuery(window).scroll(function () {
        if(jQuery(this).scrollTop() > startY ){
            jQuery('.fixedDiv').slideDown();
        }else{
            jQuery('.fixedDiv').slideUp();
        }
    });
    });
    

    Not sure what the extra line (line 3) does but that what was missing …
    Thank You

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On hover I want my div to scroll down. I know i can use
I want that on hover of image, div box should appear and user can
The divs below appear in that order in the HTML I am parsing. //div[contains(@class,'top-container')]//font/text()
I have a div to show a message, I want the message to appear
Here's the situation: I want an element to appear on top of a link
I want to schedule a <div> to appear for users at midnight at their
I'm making website that have notification 'button'. When user click this button, notification div
I have a div that appears when a user scrolls down a page (you
I want to overlay a div over the viewport when the user drags a
I have two divs inside a div, I want them both adjacent to each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.