Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old March 29th, 2009, 12:53 PM   #1
Highly Reputable Member
 

Join Date: Jun 2007
Location: Canterbury
Age: 21
Posts: 724
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 1840dsgn will become famous soon enough 1840dsgn will become famous soon enough
CSS Overlay Disabling clicks

Hi,

I am developing locally so unfortunately don't have a link at the moment.

I have a piece of javascript which adds an overlay to the my site to make it look like the lights have dimmed.

This is done using a png as a background-image, and works fine but for one issue.

Because the div with the backgroud image is on top of all other divs, it means I can't click anything underneath it. I know why this is but don't have a solution to it. I have z-indexded it below the rest of the site but then the effect is ruined by backgrounds on other divs.

So the problem is:

A div overlayed over the whole site, absolutely positioned, disables all actions underneath it as it is the top layer. (just like a lightbox, excpet my content is below the lightbox)

Does anyone have a solution?

Mike
1840dsgn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 29th, 2009, 01:21 PM   #2
Highly Reputable Member
 

Join Date: Jun 2007
Location: Canterbury
Age: 21
Posts: 724
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 1840dsgn will become famous soon enough 1840dsgn will become famous soon enough
Re: CSS Overlay Disabling clicks

I haven't found a solution to the problem.

I have found another way round it. My JS also now swaps in and out the problem BG images to ones with the darker bg. And uses a variable to say whether the lights are on or off.

Like...

Code:
// when lightSwitch is clicked
$("#lightSwitch").click(function () {

// If the lights are on
        if (lights == 0) {

// show the lights off div - overlay
            $("#lightsOff").show();

// set the variable to denote lights off
            lights = 1;       

// swap out the three problem background images for their darker versions     
            $('body').css('background', 'url(images/people_LO.gif) bottom left repeat-x');
            $('#header h1 a').css('background', 'url(images/logo_LO.gif) top left no-repeat');
            $('#container').css('background', 'url(images/whiteboard_LO.jpg) top left no-repeat');

// esle the lights must be off, so do the opposite to above
        } else {
            $("#lightsOff").hide();
            lights = 0;            
            $('body').css('background', 'url(images/people.gif) bottom left repeat-x');
            $('#header h1 a').css('background', 'url(images/logo.gif) top left no-repeat');
            $('#container').css('background', 'url(images/whiteboard.jpg) top left no-repeat');
        }
        return false;
Mike
1840dsgn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 24th, 2009, 09:28 AM   #3
New Member
 

Join Date: Apr 2009
Location: Redwood City, CA
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 beerspice is on a distinguished road
Re: CSS Overlay Disabling clicks

I just ran into this same problem. What worked for me was setting the z-index on the links themselves, rather than the divs -- so the divs are behind the overlay, but the links actually render on top of it.

Code:
#overlay {
  z-index: 10;
  position: absolute;
}

div.contentBehindOverlay a {
  z-index: 11;
  position: relative;  
}

Last edited by beerspice; April 24th, 2009 at 09:30 AM..
beerspice is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
disabling radio buttons vapanchamukhi JavaScript 1 October 21st, 2008 05:38 PM
Crazy disabling buttons 1840dsgn Flash and ActionScript 1 November 1st, 2007 07:46 PM
Disabling navigation buttons HalUK JavaScript 4 January 17th, 2007 07:12 AM
dissable right clicks ! bruno89 HTML, XHTML and CSS 18 July 25th, 2006 10:54 AM
Overlay two borders Gwayn HTML, XHTML and CSS 4 February 1st, 2006 02:19 PM


Search Engine Optimization by vBSEO 3.2.0 RC8