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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:47:16+00:00 2026-06-12T14:47:16+00:00

Enquire.js is a Javascipt that re-creates CSS media queries for Javascripts. This means you

  • 0

Enquire.js is a Javascipt that re-creates CSS media queries for Javascripts.
This means you can wrap your Javascripts in Media Queries. (Just like you would wrap CSS in Media Queries).

I’m not quite sure how to use it. This tutorial says this:

enquire.register("max-width: 960px", function() {
  // put your code here
});

However, when I follow that, my code stops working.

Here is an example of some Jquery Tabs without Enquire.JS. It works fine.

Here are the same tabs, but with Enquire.JS added. Now it stops working.

I’ve experimented with different variations of the code, but none of them work. What am I doing wrong?

I think you might have place the Jquery Tab code in a separate file and then link to that file from within Enquire.Js, but I’m not sure how you would do that. (Although it would be handy to know as I’d imagine it would let you keep your scripts be more reusable).

PS. This is not a criticism of Enquire.Js. I know that the problem lies squarely with my lack of proficiency in Javascript! I did spend a couple of hours searching for a solution, but couldn’t find anything.

Thanks for any help!

  • 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-12T14:47:17+00:00Added an answer on June 12, 2026 at 2:47 pm

    EDIT: enquire.js v2 is now out and the documentation includes working examples

    I know you asked me on GitHub about better documentation in general, but I came across this question here so thought I’d try to help with the specific problem you’re having here as well.

    Your original code was as so:

    enquire.register("max-width: 500px", function() {
    
        $(document).ready(function() {
            $("#tabs").tabs();
        });
    
    }).listen(); //note: as of enquire.js v2 listen() has been deprecated
    

    There’s a few small issues with this which I’ll explain now. The most obvious is that you have placed the document ready callback inside the match function. Whilst this may actually work perfectly fine, it would be considered better practice to instead have all the enquire code inside the ready callback:

    $(document).ready(function() {
    
        enquire.register("max-width: 500px", function() {
            $("#tabs").tabs();
        }).listen(); //note: as of enquire.js v2 listen() has been deprecated
    
    });
    

    This is a better approach because you don’t have to add a register callback in every match function (if you have more than one handler or more than one query.

    The second, more subtle, problem is that your media query is not considered valid. Any media query feature must be surrounded by parentheses. Also you typically want to specify a media device (briefly covered here: http://www.w3.org/TR/css3-mediaqueries/#background), usually you would pick screen for websites. The media device and media query feature you’re testing for are then separated by an and:

    $(document).ready(function() {
    
        enquire.register("screen and (max-width: 500px)", function() {
            $("#tabs").tabs();
        }).listen();
    
    }); //note: as of enquire.js v2 listen() has been deprecated
    

    That should then be all that is required to fix your code. You can see a completed example here: http://jsfiddle.net/WickyNilliams/3nXce/

    Hope that helps 🙂

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

Sidebar

Related Questions

I'm trying to use enquire.js in a project to control jQuery with media queries
I have just started using SCSS for the first time. I'm noticing that the
This is probably basic to most reading, but I can't seem to figure it
I have a generic method that looks like the following: -(NSArray *) db_select: (NSString
This is my code: db = xapian.Database(path/to/database) enquire = xapian.Enquire stemmer = xapian.Stem(<supported language>)
Good morning I would like to enquire as to how to read a list
I currently have an enquiry submission form that can only be completed by registered
I am using this code on my website (It is included in 404.php): <?php
I just want to get back to a clean working directory, exactly as it
i want to add a enquiry id number to my emails so that when

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.