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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:04:42+00:00 2026-06-03T16:04:42+00:00

I am currently using jQuery Mobile for a Phonegap application and I was wondering

  • 0

I am currently using jQuery Mobile for a Phonegap application and I was wondering how could I add a black overlay that is semi transparent over only the content of a page. I don’t want it to cover the top and bottom navbars. This would happen while I place an AJAX call to the server.

This effect is similar to the Twitter iOS app, when you are typing in the search bar.

$('#search').ajaxStart(function() {
  // what do I put here?
});

Thank you for your help everyone! Much appreciated.

  • 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-03T16:04:43+00:00Added an answer on June 3, 2026 at 4:04 pm

    I agree with meagar (who should make his comment an answer so it can be accepted!) but would also add that if you don’t want the overlay div to always be present (but just hidden), you can add it on the fly instead:

    $('#search').ajaxStart(function() {
      $('#content').wrap('<div class="overlay" />');
    });
    

    (#content represents whatever you happen to call your content wrapper and .overlay is the name I happened to choose for mine; easily changed!)

    Whenever the Ajax complete callback fires (which will also be where the .hide() would be used in meagar’s suggestion), just unwrap it again with this:

    $('#content').unwrap();
    

    The rest is CSS.

    .overlay { 
        position: relative;
        height: 100%;
        width: 100%;
        background-color: rgba(0,0,0,0.7);
    }
    

    Keep in mind… this may not in fact be the right CSS approach, depending on what’s already on your page. The basic idea is that you want it to span just your content area, but there are traps! Floats, absolute positioning of some things… all conspire to make your overlay not cover only the content area. If you run into that trouble, it’s a separate SO question though. 😉

    JSFiddle: http://jsfiddle.net/Ff5wV/

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

Sidebar

Related Questions

I am working on a PhoneGap application using jQuery Mobile. Currently I am only
So here's my problem. I'm currently working on a PhoneGap application using jQuery Mobile
I'm currently working on a PhoneGap application that uses jQuery, jQuery mobile and a
I am developing a PhoneGap application with JQuery mobile which requires geolocation data. Currently
I am currently building a game in phonegap using jQuery Mobile frame work. What
In my PhoneGap/jQuery Mobile app, I'm currently using PhoneGaps' Camera API to allow the
I'm currently making a jQuery Mobile application and using Phone Gap to deploy to
Working on a mobile application using jquery mobile and phonegap framework. My question is
I'm currently evaluating the combination of jQuery Mobile and PhoneGap. For my application, I
I'm currently using jQuery Mobile and this validation framework . Everything was fine until

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.