Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2004, 02:15 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default z-index and focus

let the case of two <DIV>s super-imposed on each other.
u know that of both, whose z-index is lower, will get the focus like mouseover, mouseout etc.

but i want just that, <DIV> that has lower z-index, that is covered by <DIV> of higher z-index, should get the focus.

is this possible in JavaScript ?
__________________
`~@#\^%&*/\.<.\/-|+|_!:;..=?>
PHP, SEO | anshul shrivastava | mediasworks.org | FB
 
Old July 28th, 2004, 08:08 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Anshul,

I don't think this is possible, altough you could create a transparent div (the same size & position as the bottom div) above the top div & handle the events there, something like...

Code:
<html>
    <head>
        <title>Test Full Width</title>
        <style type="text/css">
        #Upper, #Lower, #Transparent{
            position: absolute;
            width: 100px;
            height: 100px;
        }
        #Upper{
            left: 50px;
            top: 50px;
            z-index: 100;
            background-color: darkblue;
        }
        #Lower, #Transparent{
            left: 20px;
            top: 20px;
        }
        #Lower{
            z-index: 50;
            background-color: lightblue;
        }
        #Transparent{
            z-index: 100;
        }
        </style>
    </head>

    <body>
        <div id="Upper" onclick="alert('Upper clicked');"></div>
        <div id="Lower"></div>
        <div id="Transparent" onclick="alert('Transparent clicked');"></div>
    </body>
</html>
HTH,

Chris

 
Old July 29th, 2004, 02:31 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

thank u4ur idea, ChrisScott. i'll c if it can fulfil me. thanx





Similar Threads
Thread Thread Starter Forum Replies Last Post
Focus dhoward Javascript 3 September 19th, 2007 02:54 AM
Focus dhoward VB.NET 2002/2003 Basics 0 September 13th, 2007 02:23 PM
focus kvanchi General .NET 2 December 13th, 2004 09:16 PM
Focus jbenson001 ASP.NET 1.x and 2.0 Application Design 2 February 18th, 2004 02:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.