Tutorial :How to load jquery “Modal Window” Before Page load?


I'm making a site in two language ,I want to give a "jquery Modal Window" before English page load to give a option to choose another language link (on a modal window).If user will click on Second language link he will go for that page and if he want to stay with english he just needed to close the window.


If you want the user to pick a language before using a site, and your current plan is to present them with a "modal" jquery dialog...then a more usable, user-friendly approach would be to create a language-selection landing page that users will be presented upon entering your site. A landing page like this, for all intents and purposes...is modal, but its much more accessible to your users. If any of them have javascript disabled for any reason, or are using a browser, cough IE cough, that doesn't render dhtml-based "modal" stuff very well, then at least your users arn't presented with anything quirky that may make it difficult or impossible for them to actually choose their language of choice.

That said, if you want a script to run at a specific point during your page load...just place the script directly inside the <script> tags, without any function or other wraper around it. Browsers will execute inline script as soon as that script block is loaded, even if the document is not yet "ready".


Don't wrap your code in document ready, if your modal plugin requires a particular DIV to be in the document, put the div directly under the body tag and the javascript code directly under that.


Why don't just you ask them when the page is loaded ?

What's the matter ? I mean, just provided them the option to choose between the available language. It is not so annoying, the most important is to remember their choice.

Try to display a modal box before the dom is ready is painful..

What about a notice bar like SO ?

Anyway to answer to your question, i guess you should do like a 'Loading' page works.

Setting CSS and hide all other things and use a modal box plugin for JQuery

Then just show() the content of your page

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »