Solved

How to Create a Modal to Cover Entire Web Page using CSS and JavaScript

Posted on 2012-03-27
2
900 Views
Last Modified: 2012-08-14
I am new to web developing, and I was wondering how one would create a modal over an entire web page. The goal is to grey out the entire contents of the web page, coded in asp .net, and make a custom message box popup using JavaScript code. (I have attached the code for the basic *.aspx page for reference.) Could someone let me know what would be the basic method and the basic code, maybe illustrated with an example, to grey out an entire page and make a modal window appear on the page, without being a JavaScipt popup window, on the same page? Any help would be greatly appreciated.
healthRiskTerms.aspx
0
Comment
Question by:thenthorn1010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
Tony van Schaik earned 500 total points
ID: 37773745
With only CSS this is quite tricky, because those Javascript lightbox/thickboxes also have some cross-browser fixes in it.

For example the way Firefox renders the opacity is different than in Internet Explorer and don't forget about all those older browser versions like IE6, IE8, quirksmode etc

If you want to use CSS for fixing everything is a lot of work, the javascripts versions do these checks and fixes for you based on the browser that visits your website.

The modal dialogs i use are these:

http://jqueryui.com/demos/dialog/
http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
http://www.shadowbox-js.com/

My advice, use a javascript version it's more bulletproof. And it some much easier to maintain and use it for other purposes on your website, like loading an image in the dialog box or video, iframe and so on.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Set css in function 11 56
Change background images after 5 seconds. 12 48
Slow Down an Animation 3 29
CSS Selector Chain NOT working for this situation? 3 16
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question