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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:43:26+00:00 2026-06-17T08:43:26+00:00

I have a jquery if statement that doesn’t quite work the way it should,

  • 0

I have a jquery if statement that doesn’t quite work the way it should, I think it’s close, but doesn’t seem to quite want to work:

I’d like it to following the following:
if it’s a ios device I want it to do one thing, if it’s a window with a height greater then 500 px but less then 830 then do the other thing and if it’s neither of those things do the third thing

var deviceAgent = navigator.userAgent.toLowerCase();
var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);


if(agentID) {
    $("#about_container").css({
        height: $(window).height() + 500
    });
    $("#about_main_header_container").css({
        paddingBottom: (($(window).height() - $("#about_content_total").outerHeight(true)) /2) - 50
    });
    $("#services_wrapper").css({
        height: $(window).height() + 190
    });
    $("#services_main_header_container").css({
        paddingBottom: (($(window).height() - $("#services_container").outerHeight(true)) /2) - 10
    });
}
else if ($(window).height() > 500, $(window).height() < 830) {
$("#about_container").css({
    height: 830
});    
$("#services_wrapper").css({
    height: 830
});
$("#services_main_header_container").css({
    paddingBottom: 160
});
$("#about_main_header_container").css({
    paddingBottom: 130
});
}
else {
    $("#about_container").css({
        height: $(window).height() - 65
    });
    $("#about_main_header_container").css({
        paddingBottom: (($(window).height() - $("#about_content_total").outerHeight(true)) /2) - 175
    });
    $("#services_wrapper").css({
        height: $(window).height() - 100
    });
    $("#services_main_header_container").css({
        paddingBottom: (($(window).height() - $("#services_container").outerHeight(true)) /2) - 175
    });
}
  • 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-17T08:43:27+00:00Added an answer on June 17, 2026 at 8:43 am
    else if ($(window).height() > 500, $(window).height() < 830)
    

    is not right, it should be:

    else if ($(window).height() > 500 && $(window).height() < 830)
    

    In javascript, a,b will just return b.

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

Sidebar

Related Questions

I have some jQuery code that doesn't work as expected. $('a[href^=http://]').not('[href^=http://mydomain.com], [href^=http://itunes.apple.com]').click(function (e) {
I have a jQuery statement that's working fine. How would I re-write it in
I have the following JQuery statement and it is adding the class 'current' but
I tried to add a conditional statement for IE7 with jQuery, but it doesn't
Does Javascript or jQuery have sometime like the in statement in Python? a in
I have jQuery load asset on my layout and I want to use CHtml::ajaxButton/ajaxSubmitButton
I have jquery ui dialog box, and I want to resize it by the
I have the following jQuery click() function that needs to send the form data
I am trying to write a simple if statement in javascript (jquery library) that
I have a jQuery script that manages a submenu. When the user clicks 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.