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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:40:35+00:00 2026-05-23T10:40:35+00:00

I have this crazy bug that only comes up sometimes. It was apparent when

  • 0

I have this crazy bug that only comes up sometimes. It was apparent when I was developing this site but then it disappeared for a week or so and now that the site is live it’s back. I don’t think it has anything to do with my hosting because it bugs out locally as well.

My problem is that I’m swapping the css value background-image on each click. It works perfectly 95% of the time, but sometimes for a span of like 15 minutes it just won’t display about half the images, seemingly randomly. The strangest thing is that if you look in the inspector you can see that the script correctly changed the css value, but the image simply wasn’t loaded. I have no idea why!

Here’s the website: shouldivoteoliver.com It’s on the “Propaganda” page.

Here’s the Javascript:

$(document).ready(function() {
    var n=0;
        $(".button").click(function(){
            if (n===5){
                $('<video style="position:relative;left:250px;" src="http://dl.dropbox.com/u/1011105/6.ogg" controls="controls">your browser does not support the video tag</video>').appendTo($('#putin'));
                n++;
                $("#putin").css("background-image","none");
                }
            else{
                $('video').remove();
                $("#putin").css("background-image",function(){
                    if (n>13){
                    n=1;
                    return ('url(images/1.jpg)');
                    }
                    else{
                    n++;
                    return ('url(images/'+n+'.jpg)');
                    }
                    });
            }
        });
});
  • 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-05-23T10:40:36+00:00Added an answer on May 23, 2026 at 10:40 am

    I would suggest using a background image as a sprite and changing the background position as
    opposed to changing the background image property.

    Here is a tutorial that I googled

    http://www.noobcube.com/tutorials/html-css/css-background-image-sprites-a-beginners-guide-/

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

Sidebar

Related Questions

i have this crazy label for each time i create a migration that use
Ok, this is driving me crazy. I have a CA that needs to know
I have a crazy situation that I cannot figure out: I have this string:
I have this little crazy method that converts BigDecimal values into nice and readable
I have this question that is driving me crazy: could I save a PDF
This is driving me crazy. I have this one php file on a test
This is crazy, I have been trying for hours to get this to work.
This has been driving me crazy for the past few minutes I have a
This is driving me crazy. I have a very simple user control: public int?
Okay, this is just a crazy idea I have. Stack Overflow looks very structured

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.