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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:23:27+00:00 2026-06-17T15:23:27+00:00

I load a background image through jquery into a DiV, and occasionally a modal

  • 0

I load a background image through jquery into a DiV, and occasionally a modal pops up which stretches the screen height so that you have to scroll.

I wanted to have my bg image scroll with the view, but the issue is that height:100% apparently means 100% of the original height. The div doesn’t stretch with the rest of the screen.

Why is that? Here is my code:

#bgDiv {
    display: none;
    height: 100%;
    width: 100%;
    background-repeat: no-repeat;
    background-position: center center;
        background-attachment:fixed;
    top:0;
    right:0;
    position: absolute;
    z-index: -9999;
}

Thanks!

  • 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-17T15:23:28+00:00Added an answer on June 17, 2026 at 3:23 pm

    If you set your position to fixed instead of absolute, it should stay, even when there is scrolling.

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

Sidebar

Related Questions

I have a script that switches background image on hover: $('div#example').hover(function(){ $(this).css('background',url('images/bg_2.png') no-repeat bottom);
I am trying to load an image in the background as someone works through
Is there a way, without javascript, to load a small image for a background
Background I have inherited a load of XML files that consistently contain a tag
js doesn't work if I don't refresh the page after first load,and div's background-img
I have been working on making a form that uploads an image through ajax
I am trying to load images from the Facebook graph api into a div
I'm using jQuery to control an image gallery that will display any of several
I have following code on my site: backgroundImages[bg_img_path_b]=new Image(); backgroundImages[bg_img_path_b].src = bg_img_path_b; backgroundImages[bg_img_path_b].loaded=loading; //jQuery(backgroundImages[lastImage]).unbind('load.backgroundImages');
There is a div #container which contains various divs with large background images, I

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.