Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
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 February 9th, 2006, 10:31 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default show div over top of selects (drop downs)

I have drop down menus on my page.

When I mouseover an image a floating DIV appears at the foot of the screen.

However, the <selects> dropdowns show through the div when the div is positioned over the selects????

Is there a way to have the div appear over the dropdowns, without hiding the drop downs???

Thanks.
Picco

www.crmpicco.co.uk
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old February 9th, 2006, 11:17 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

To solve the problem in IE, you can create an iframe in the same position as your div with opacity of 0 using a filter. This will hide the part of the select box that would normally show through.

HTH,

Chris


 
Old February 9th, 2006, 11:27 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

im not overly sure what you mean chris,this is the CSS i am using
Code:
.demo {color:#000000; border-color:#666666; background-color:<%=minirules%>; font-family:Verdana, Arial, Helvetica, sans-serif;    font-weight:bold; layer-background-color:#cccccc; position:absolute; bottom:0px; width:100%; height:100px; visibility:hidden; z-index:5; border-color:#FFFFFF; border:inherit;}
The div is always positioned at the foot of the page, should the selects be wrapped in a DIV?

Thanks.

Picco

www.crmpicco.co.uk
 
Old February 9th, 2006, 12:11 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

This should get you started...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>div over select</title>
        <style type="text/css">
        #myDiv, #myIframe{
            width: 150px;
            height: 150px;
            position: absolute;
            top: 10px;
            left: 10px;
        }
        #myDiv{
            background-color: lightgrey;
            z-index: 10;
        }
        #myIframe{
            filter: "progid:DXImageTransform.Microsoft.Alpha(style=0, opacity=0)";
            z-index: 9;
        }
        #mySelect{
            width: 300px;
            height: 200px;
        }
        </style>
    </head>
    <body>

    <form>
        <select id="mySelect" multiple="multiple"></select>
    </form>


    <div id="myDiv">some text</div>
    <iframe id="myIframe"></iframe>

    </body>
</html>
HTH,

Chris

 
Old February 10th, 2006, 05:21 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

thanks chris, i'll give it a try.
so you are saying put the iframe underneath my div?

www.crmpicco.co.uk
 
Old February 10th, 2006, 05:40 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Picco,

Yep, exactly that - it obscures the select element and using a filter on it stops it showing through your div.

Cheers,

Chris

 
Old February 10th, 2006, 06:23 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

ok, when you say obscure you mean it is not actually hidden? the div is just shown on top of it?

www.crmpicco.co.uk
 
Old February 10th, 2006, 06:31 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yep, try the example, it shows the div over a select element without hiding the select element.

 
Old February 10th, 2006, 06:56 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

great, i am working on a bit of database work at the mo, but will get back to it

www.crmpicco.co.uk
 
Old February 13th, 2006, 12:29 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

a new problem i am experiancing is that because the DIV is built dynamically the height changes, sometimes it is 100px sometimes is is 300px?? So is there a way to make the CSS dynamic?

www.crmpicco.co.uk





Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Drop downs - 2 col socoolbrewster CSS Cascading Style Sheets 5 December 22nd, 2007 05:32 AM
dealing with drop downs lisabb ASP.NET 2.0 Basics 5 May 28th, 2007 12:29 AM
dependent drop downs p2pMember ASP.NET 1.0 and 1.1 Professional 0 July 19th, 2006 05:25 AM
Day of week Drop Downs jeffbarclay Javascript How-To 5 November 17th, 2003 08:28 PM





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