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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:44:21+00:00 2026-06-04T19:44:21+00:00

Yes, I know there are countless posts about sliding images right to left (and

  • 0

Yes, I know there are countless posts about sliding images right to left (and LTR), but I haven’t seen one yet to solve my specific problem.

I’ve got several divs that I’m using as my backgrounds. In order to get them to slide right to left, I am setting the “left” in css to the width of the image and then animating that image in to a “left” of 0 (and the previous hero image from css left of 0 to -image width). The problem is that the scroll bar on the browser is showing up and disappearing whenever the animation takes place. Is there any way to not have the scrollbar show during the animation.

I realize the scrollbar is showing because I am setting the css “left” off to the right of the screen but don’t know any other way to allow sliding in from the right

<div id="hero_bg">
   <div class="hero"><img src="/img/one.jpg" /></div>
   <div class="hero"><img src="/img/two.jpg" /></div>
   <div class="hero"><img src="/img/three.jpg" /></div>
</div>

and the CSS is:

.hero
{
    position: absolute;
    display: none;
    width: 1245px;
    height: 619px;
    left: 0px;
    top: 0px;
    z-index: -1000;
}

and finally the JS:

$(document).ready(function () {
    $('.hero').hide();

    var delay = 2000;
    var divIdx = -1;
    var arrDiv = $("div.hero").toArray();

    function bgSlide() {
        if (divIdx < 0) {
            divIdx = 0;
            $(arrDiv[divIdx]).show();
        } else {
            var $out = $(arrDiv[divIdx]);
            divIdx = (divIdx + 1) % arrDiv.length;
            var $in = $(arrDiv[divIdx]);
            $in.css('left', $in.outerWidth());
            $in.show();
            $out.animate({ left: -$out.outerWidth() });
            $in.animate({ left: 0 });
        }
    }

    setInterval(bgSlide, delay);
});
  • 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-04T19:44:22+00:00Added an answer on June 4, 2026 at 7:44 pm

    CSS:

    body{ overflow:hidden}
    

    or (CSS 3)

    body{ overflow-y:hidden;}
    

    or (CSS 3)

    body{ overflow-x:hidden;}
    

    or use jquery to set the above css during animating time

    $('body').css("overflow","hidden"}
    

    *my syntax might be wrong as I am writing this from my head

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

Sidebar

Related Questions

Yes, I know there's AlertDialog.Builder, but I'm shocked to know how difficult (well, at
Yes, I know there are four Memory windows, but I much prefer the display
I know there are several question like this one but I feel I've spent
Right away: yes I know about INTERNAL_IPS. I'm about to have my django app
Yes, I know there is MonoDevelop . But what if I want to use
Yes I know there has been similar posts to this however after looking through
I know there are alot of different questions about this but none of them
Yes, I know there's Voter tutorial in cookbook . But I'm looking for something
I know there are many other posts on here with similar questions, but I
Yes, I know, the archive bit is evil. That being said, is there support

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.