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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:42:22+00:00 2026-05-27T09:42:22+00:00

There seems to be a problem with my DOM, in that the style of

  • 0

There seems to be a problem with my DOM, in that the style of elements are all appearing blank.

My jQuery is simply

// JavaScript Document
$(document).ready(function(){
    $(#mainContent).css("min-height", function(){
        return $(window).height() + 'px';
    });
});

Nothing happens on page load.

I suspect there is not a problem with the syntax, or if there is, this is not what is causing my problem. I have tried to script this myself in javascript and it yielded similar results which is why I turned to jQuery in the first place.

if I

alert("text") 

it works fine but if I try

$(#mainContent).css("min-height")

then nothing happens.

I have, in a separate javascript file created a variable which is simply

var mainCon = document.getElementById("mainContent");

and using firebug, put a breakpoint in after the variable is declared, then when inspecting the variable using firebug, everything within styles is blank, eg

height ""
width ""
color ""

etc.

I have absolutely no idea what is causing this problem and I am losing sleep over it, I have scraped the hell out of google and can’t seem to find anything relevant.

Any help you can find will be massively appreciated,
Thanks in advance

  • 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-27T09:42:23+00:00Added an answer on May 27, 2026 at 9:42 am

    You need to quote your selectors (specifically #mainContent):

    $(document).ready(function(){
        $("#mainContent").css("min-height", function(){
            return $(window).height() + 'px';
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found that there seems to be a problem using css transitions properties when
I want to test the phpDocumentor-alpha, and there's a problem that some people seems
There seems to be a problem when virtualenv is used in PowerShell. When I
Hi i encountered this problem whereby when i initialized my String[], there seems to
Seems there's nothing to do… using the combo prototype/lowpro, no problems at all with
Does anyone know how I can style dynamic elements created via the DOM method
There are a lot of questions about binding future manipulations to non-existent elements that
It seems pretty common to want to let your javascript know a particular dom
It seems that all of the documentation that I could find on jsdom were
I am building an interactive visualization app that is pretty much all client-side Javascript,

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.