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 9259865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:45:30+00:00 2026-06-18T12:45:30+00:00

http://jsfiddle.net/asif097/AzRtC/3 As you can see there are two buttons when the 1st button is

  • 0

http://jsfiddle.net/asif097/AzRtC/3

As you can see there are two buttons when the 1st button is clicked some jquery functions are beeing run (see bellow the red div, more contents are being loaded), same happens for the second button.

Now I wanted to use jquery scroll function instead of the click function (to run those jquery animation same as the click) .

Tried this one but doesn’t work. Any one one to fix the code?

Note: I’m new to jquery.

 $(window).scroll(function() {
    if ($(this).scrollTop() > 1000) { // instead of the click button#go tried bellow code
      $(".more").css("display", "block");
      $("#block1").removeAttr('style');
      $("#block2").removeAttr('style');
      $("#block3").removeAttr('style');
      $("#block4").removeAttr('style');
      $("#block5").removeAttr('style');
      $("#block1").css('display', 'block').animate({
          opacity: 1,
          marginTop: 0,
          top: 0,
          }, 1300, 'easeOutExpo');

      $("#block2").css('display', 'block').animate({
          opacity: 1,
          marginTop: 0,
          top: 0,
          }, 2000, 'easeOutExpo');;

      $("#block3").css('display', 'block').animate({
          opacity: 1,
          marginTop: "13px",
          }, 2000, 'easeOutExpo');

      $("#block4").css('display', 'block').animate({
          opacity: 1,
          marginTop: "-208px",
          marginRight: 0
          }, 2000, 'easeOutExpo');

      $("#block5").css('display', 'block').animate({
          opacity: 1,
          marginTop: "13px",
          marginRight: 0
          }, 2000, 'easeOutExpo');

    }

    else if ($(this).scrollTop() > 1000) { // instead of the click button#go2 tried bellow code
      $(".more2").css("display", "block");
      $("#block6").removeAttr('style');
      $("#block7").removeAttr('style');
      $("#block8").removeAttr('style');
      $("#block9").removeAttr('style');
      $("#block10").removeAttr('style');
      $("#block6").css('display', 'block').animate({
          opacity: 1,
          marginTop: 0,
          top: 0,
          }, 1300, 'easeOutExpo');

      $("#block7").css('display', 'block').animate({
          opacity: 1,
          marginTop: 0,
          top: 0,
          }, 2000, 'easeOutExpo');

      $("#block8").css('display', 'block').animate({
          opacity: 1,
          marginTop: "13px",
          }, 2000, 'easeOutExpo');

      $("#block9").css('display', 'block').animate({
          opacity: 1,
          marginTop: "-208px",
          }, 2000, 'easeOutExpo');

      $("#block10").css('display', 'block').animate({
          opacity: 1,
          marginTop: "13px",
          }, 2000, 'easeOutExpo');
    }

    else {
        return false;
    }
});
  • 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-18T12:45:31+00:00Added an answer on June 18, 2026 at 12:45 pm

    The only problem with your code is that $(this).scrollTop() will never be larger than 1000.

    According to the define of .scrollTop()

    The vertical scroll position is the same as the number of pixels that are hidden from view above the scrollable area. If the scroll bar is at the very top, or if the element is not scrollable, this number will be 0.

    So it will be different when scroll to the bottom, while the height of window is different.

    So I use $(this).scrollTop()+$(window).height() instead of $(this).scrollTop(), it will almost be the same.

    Here is jsfiddle. http://jsfiddle.net/AzRtC/5/

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

Sidebar

Related Questions

http://jsfiddle.net/ADLrh/ Hopefully you can see what I'm after. The three 'fillers' on the top
http://jsfiddle.net/B2rdD/3/ I've Created 25 buttons using HTML and I have written jquery code such
http://jsfiddle.net/Zyjwb/5/ How can I display actual names of owners , based on the specified
http://jsfiddle.net/nWqYL/2/embedded/result/ I've been working on fixing some issues with this prototype site. Myself and
http://jsfiddle.net/DaJWC/ i can't figure out how to make one of the links reverse so
http://jsfiddle.net/motocomdigital/gUWdJ/ I'm after a jquery scroll technique please that I would like to adapt
http://jsfiddle.net/WH8tW/6/ I am having some issues with trying to get vanilla masonry to work
http://jsfiddle.net/Ht8eP/3/ In the previous example I catch every clicked list item explicitly by it's
http://jsfiddle.net/herrturtur/ExWFH/ To try this: click the plus button, double click the newly created name
http://jsfiddle.net/borayeris/sb9Ju/4/ Here is my script. How can I stop fading out if mouse is

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.