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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:18:01+00:00 2026-06-14T23:18:01+00:00

I want to add few images for my game scoreboard as background using jquery.

  • 0

I want to add few images for my game scoreboard as background using jquery.

eg. header.jpg for header, footer.jpg for footer and body.jpg for body.
I have created a small game in jquery.

Currently, My game scoreboard is showing only few text messages. I want to show them on some background image.

Below is my code which i am using to show text messages. Please help me so that i can display background images on them.

code:

     ......................
     ......................
        else {
        goldenGoal = false; 
        $("#message1").html("You Lose"); 
        $("#message1").css("color", "red");
          $("#message1").css("size", "190px");
        $("#play").html("Play Level Again");
        $("#lgoals").html(0);
        $("#vgoals").html(0);
        stats.loses++;
        //level = 1;
        //fps = 50;
        //difficulty = 0.2;
    }
       ..................
       ..................
  • 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-14T23:18:02+00:00Added an answer on June 14, 2026 at 11:18 pm

    Basically, you have to do something like that:

    $('#containerID').css('background-image', 'url(path/to/image.jpg)');
    

    Or, in your example:

    $('body').css('background-image', 'url(body.jpg)');
    $('#header').css('background-image', 'url(header.jpg)');
    $('#footer').css('background-image', 'url(footer.jpg)');
    

    By the way, just as an input: Try to optimize your code. It’s (unremarkably!) faster and just cleaner. Example:
    Instead of

    $("#message1").html("You Lose"); 
    $("#message1").css("color", "red");
    $("#message1").css("size", "190px");
    

    You could do

    $("#message1")
        .html("You Lose")
        .css({
            "color": "red",
            "size": "190px"
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website where I display student info. I want to add few
I have few nested DIVs at page. I want to add event only for
I have a few images on the screen and I want that each click
I am using opencv 2.1. In my code I have a few images stored
I want to add a few dynamic rows right in the middle of a
I have a website built with ASP.NET (3.5) and want add some level of
I have a list of string values that I want add to a hashtable
I have problem, when I want add Node to my GUI from other Thread.
I have a GUI written using netbeans with a few simple components in place.
I am using one template to build my web site. I want to add

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.