jquery - how to prevent users' interaction when waiting for ajax's response -


The scenario is such: I'm using the jacquery to apply some Ajax features. For example: When a user clicks on the "Get Data" button, the jazzery will perform a .jax function to fetch some data from the server. This process can take some time, so I added. Complete work to show some animation for the execendend and .exe waiting process (actually a 'loading data' gif, in which a div of within a jade-index: 999 Inside other divs). During the waiting process ('loading data'), I want to prevent users from clicking other buttons (for example: I have other tabs, small 'loading data' button below GIF). The way I got it:

  $ ("body"). AjaxSend (function () {$ (this) .append ('& lt; div id = "loading" & gt; Data $ ("div # error" is loading); $ (this). $ (This). Children (). No ('# loading'). CSS ({'opacity': 0.22});}); $ ("body"). AjaxComplete (function () {$ ("div # loading") Remove (); $ (this). Child () .No ('# loading'). CSS ({'opacity': 1});});  

However, It does not seem that changing the ambiguity is the best way.Unless you make ambiguity to 0, the user can still click on the other buttons / tabs. I do not know if this How to avoid interaction with any user during operation? Thanks!

Use the overlay .


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -