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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:47:57+00:00 2026-06-15T05:47:57+00:00

What I am trying to do is show a full screen background image on

  • 0

What I am trying to do is show a full screen background image on screens that are large enough and it works on most browsers but it is causing problems on others. I ran it through the W3 Validator and it says that XHTML doesn’t support Div and Img tags in document.write. How else would I code this without document.write so that it would pass the validator and not cause errors on some browsers?

<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="jquery.fullscreenBackground.js"></script>
<script type="text/javascript">
$(document).ready(function () {
        $("#background-image").fullscreenBackground();
    });
</script>

            <script type="text/javascript">
var viewPortWidth = $(window).width();
var viewPortHeight = $(window).height();
if (viewPortHeight >= 300 && viewPortWidth >= 400) {
document.write("<div id='background-image'><img src='BGLarge.gif' alt='background' width='1920' height='1080' ></div>");
}
else {
document.write("");
}
</script>
  • 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-15T05:47:59+00:00Added an answer on June 15, 2026 at 5:47 am
    if (viewPortHeight >= 300 && viewPortWidth >= 400) {
      $('body').prepend('<div id="background-image"><img src="http://thetylerpress.com/new/BGLarge.gif" alt="background" width="1920" height="1080" ></div>');
    }
    

    You wont be needing the else statement

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

Sidebar

Related Questions

I'm trying to show content below a full-screen slideshow that behaves normally. Only when
I have an image that I would like to show in full regardless of
I am trying to setup my PowerShell command, so the Get-Help -full will show
I'm trying to have a full screen UI with a fix header ( a
In ActiveAdmin 0.4.3, and Rails 3.2.2 I'm trying to customize the show screen of
I'm trying to find a way to draw something on the screen that will
I am trying to override home key and full screen the acitiy using below
Trying to show a label only when a certain item in a combo is
I'm trying to show/hide( or simply put - filter ) my markers( of houses
I'm trying to show a UIAlertView before actually deleting a cell from a UITableView

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.