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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:09:38+00:00 2026-06-05T15:09:38+00:00

In plain English this is the jQuery functionality i’m after: I need to get

  • 0

In plain English this is the jQuery functionality i’m after:

I need to get the width and the height of the browser window and then get the height of .banner div (height is automatic). If the height of .banner div is higher than that of the height of the browser window append .title div and .social div to the body otherwise display .title div and .social div within .banner div.

How do I then style the two divs accordingly (.title and .social)?

EDIT:
This is my on page load code in HTML:

<div class="banner">
   <div class="title">
      <!--to be positioned 40px from the left-->
   </div>
   <div class="social">
      <!--to be positioned 40px from the right-->
   </div>

   <img src="URL"/> <!-- Image determines height of DIV uses max-width -->

</div>
  • 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-05T15:09:39+00:00Added an answer on June 5, 2026 at 3:09 pm

    You can do something like below:

    var windowHeight = $(window).height(); //Gives you the browser viewport height
    var bannerHeight = $(".banner").height();
    
    if (bannerHeight > windowHeight) {
        $("body").append($('.title'));
        $("body").append($('.social'));
    
        //Then you can style them using jQuery .css
        //Example
        $('.title').css('color', 'red');
    }
    else {
        //Display .title and .social in your .banner div
    }
    
    • jQuery .height info: http://api.jquery.com/height/
    • jQuery .css info: http://api.jquery.com/css/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in plain english can you please explain to me what does this line mean:
Possible Duplicate: Plain english explanation of Big O I'd imagine this is probably something
In plain English, this code kicks in when an element is hovered over. When
Can someone explain in plain english the syntax of this: Here is the signature
I'm using plain English here. I've got this great app with multiple tabs and
In plain English, how is $this used in PHP? It's such a simple concept
In plain English, what are the disadvantages and advantages of using SET TRANSACTION ISOLATION
The code below allows the user to enter in a phrase in plain English,
Assembly.Location gives a plain path to the assembly. Unfortunately this is empty when running
I've got this plain HTML: Many things are in my room: a bed, a

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.