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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:53:28+00:00 2026-06-12T11:53:28+00:00

I am loading my mobile only CSS using a media query such as <link

  • 0

I am loading my mobile only CSS using a media query such as

<link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="/includes/css/mobile.css" />

but in addition to these CSS changes I also need to reorder part of the HTML such as

$('#moveOne').after($('#theOther');

I only want this move to be actioned if the browser has definitely loaded the mobile.css. So I thought of adding some odd CSS value inside mobile.css and then checking the value of it like so

if($'#notVisible').css('color') == 'red') {
    $('#moveOne').after($('#theOther');
}

Is there a better way of doing this?

  • 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-12T11:53:29+00:00Added an answer on June 12, 2026 at 11:53 am

    I think, what you are doing is absolutely good.

    But a more logical way would be setting width instead of color.

    if($'#notVisible').width() == '500px') {
        $('#moveOne').after($('#theOther');
    }
    

    Also, you can try matchMedia.js

    Look here Using_media_queries_from_code too.

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

Sidebar

Related Questions

So I'm using an @media query to use a different css file on the
I am using relative path to include jquery mobile. But when loading thru a
I have a mobile app, which is pretty data driven, though only through text
I have a Jquery Mobile page into which I'm loading a form via AJAX.
I am currently looking at jQuery mobile and its system of loading web pages
When loading the class, using method forName() , any static initializers in the class
After loading a PHP template (using jQuery's load function), this simple script won't make
I have a bunch of CSS written that makes my site target Mobile first,
I have the following jQuery Mobile HTML code, the navbar's content is set using
I am developing an application using titanium mobile. On the simulator, the app works

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.