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

  • Home
  • SEARCH
  • 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 8885815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:24:13+00:00 2026-06-14T21:24:13+00:00

I have found out how to show divs when you reach past a scroll

  • 0

I have found out how to show divs when you reach past a scroll position. The JQuery code I am using to do so is this:

$(window).scroll(function() {
if ($(this).scrollTop() > 75) {
    $("#ddmenubg2:hidden").fadeIn('slow');
}
else {
    $("#ddmenubg2:visible").fadeOut("slow");
}

});

As far as I know this is telling the div ddmenubg2 to be hidden before you reach the 75 scrolling mark, then anywhere past that mark, the div stays visible… and anything before that mark, the div is hidden. But, for some reason the ddmenubg2 div is on my page before the 75 pixel mark. The div then fades away and re-fades in when I enter past the 75 mark. This only happens on the first page load or refresh, it works fine after you scroll up and down multiple times, but whenever you refresh the page this problem occurs until you scroll down.

Now, a short fix to this problem is making the ddmenubg2 div’s display “none”. This actually fixes the whole scrolling issue but it leaves my main menu functioning incorrectly.

So how would I make this so the ddmenubg2 div stays hidden before you go past 75 and stay once you go past 75.. even on the first page load or refresh?

  • 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-14T21:24:15+00:00Added an answer on June 14, 2026 at 9:24 pm

    Use visibility: hidden instead of display none. This will keep the elements width and height attributes but will make it not visible. Here is how I modified your code to make it work.

    The CSS

    #ddmenubg2{
       visibility:hidden;
    }
    

    The javascript

    $(function(){
        $(window).scroll(function() { 
            if ($(this).scrollTop() > 75) { 
                $("#ddmenubg2:hidden").css('visibility','visible');   
                $("#ddmenubg2:hidden").fadeIn('slow');  
            } 
            else {     
                $("#ddmenubg2:visible").fadeOut("slow"); 
            }  
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched and found out this code to save data to database, connection
In this post: Using of PhotoChooserTask I have found out that it is possible
I have found plenty of information out there about this error: 'ERROR: Could not
I have done some research on this subject, and found out, that Gzipping and
I have found out that C++ standard functions show very different behavior when having
I have found the oddest behavior with my iOS app. I have this code:
I have found a tutorial on some dropdown menu using jquery. It works fine
I have found out that I am doing WPF wrong and frustratingly must overhaul
I have to start work on phone gap. Till now i have found out
I have recently found out that there exists a method called nth_element in the

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.