How to grey out a web page

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
denisw
Forum Newbie
Posts: 14
Joined: Mon Jul 24, 2006 11:21 pm

How to grey out a web page

Post by denisw »

Is there any one can give me the idea how to grey out a web page ?
When being greyed out, all the web elements will also be disabled.

The point is I would like to have the main page deactivated while a certain dialog box (pop up window) is being run.

thanks.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: How to grey out a web page

Post by jayshields »

Why not look into some existing code that does the same thing. Chances are they'll have it wrapped in a nice function for you to lift right out. LightBox is one thing I know that does this for sure.
marcth
Forum Contributor
Posts: 142
Joined: Mon Aug 25, 2008 8:16 am

Re: How to grey out a web page

Post by marcth »

Checkout GreyBox
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: How to grey out a web page

Post by JAB Creations »

http://www.jabcreations.com/blog/

Click on 'Site Options' or 'Site Themes' at the top right.

Don't use a framework, just change the class of the page's parent most element (but don't use body).

JavaScript

Code: Select all

function change(id, newClass) {identity=document.getElementById(id); identity.className=newClass;}
XHTML

Code: Select all

<A href="javascript&#058; change('my_id', 'my_class');">change element</a>
But for my site's layers I trigger a function which fades the 'body' ID's opacity and then displays a layer. Pretty simple. :D
Post Reply