Solved

DIV overlapping... *calendar pop up*

Posted on 2001-08-07
10
801 Views
Last Modified: 2013-11-28
I have a div style calendar popup, and up to now had no problems with it... ... UNTIL I had something under the place where the calendar pops up.  It has transparent background @.@ I've tried changing the CSS of it, the DIV and everything... I hope someone here could tell me how to make it non transparent =o)

meaning I can see the underlying text on the calendar div section... it's annoying >.<

The script doesn't really matter that much.
I believe it's just a property of the DIV the Calendar uses "Div" and "Div2" respectavely that isn't set right...



code for page is:

<html>
<head>
<!-- POPUP CALENDAR SUPPORT STARTS -->
<link rel="stylesheet" type="text/css" href="calendar.css">
<script src="calendarControl.js"></script>
<script src="calendarPopup.js"></script>
<script src="anchorPosition.js"></script>
<script src="popupWindow.js"></script>
<!-- POPUP CALENDAR SUPPORT ENDS -->
</head>
<body>

Date Picker example:

<!-- DIV used by calendar popup control-->
<div id="calendarDiv" class="calendar" style="position: absolute;" align=center></div>
<div id="calendarDiv2" class="calendar" style="position: absolute;" align=center ></div>

<table width="100%">
     <tr><td>Name:</td><td><input type="text" name="firstname"></td></tr>
     <tr><td>Surname:</td><td><input type="text" name="surname"></td></tr>
     <tr>
          <td>Date:</td>
          <td>
               <input type="text" name="date" disabled></input>
                <!-- Calendar will position on ANCHOR element-->              
                <a id="calendarAnchor"/>&nbsp;</a> <!-- MUST NOT BE EMPTY -->
               <button onclick="showCalendar('calendar1');">
               <img src="calendar.gif"><br>
          </td>
          <td>
               <input type="text" name="date2" disabled></INPUT>              
               <a id="calendarAnchor2"/>&nbsp;</a> <!-- MUST NOT BE EMPTY -->
               <button onclick="showCalendar('calendar2');">
               <img src="calendar.gif">
               </button>
          </td>
     </tr>
     <tr>
          <td colspan=3>
               <input></input><br><input></input>
               <input></input><BR><input></input>
               <input></input><!--just stuff to demonstrate the 'transparency mess up'-->
          </td>
     </tr>

</table>

<script language="JavaScript">

// Initiate calendars
createPopupCalendar("calendar1", "date", "calendarDiv", "calendarAnchor");
createPopupCalendar("calendar2", "date2", "calendarDiv2", "calendarAnchor2");
</script>

</body>
</html>



Well hope you can help :)

~Ixeus
0
Comment
Question by:The_Brain
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 6359369
Give the div a background color. Or even easier, give the table in the div a background color. It can be white.
0
 
LVL 1

Author Comment

by:The_Brain
ID: 6359732
tried that @.@
didn't turn out as simple as that
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6359904
Try changing the z-index property for the overlapping divs, placing one behind the other, and using a background color...


The one you want behind (underneath so to speak) set to

.div2
{
z-index:-1;
}

and then try setting a background-color property in div1 as webwoman suggested.

.div1
{
background-color: #FFFFFF;
}

Jim s.

0
 
LVL 10

Expert Comment

by:dij8
ID: 6360354
If the background color doesn't work you could try a background image.  Say a 1x1 pixel colored image (about 64bytes in weight).  And then resize it to fit the DIV.
0
 
LVL 19

Accepted Solution

by:
webwoman earned 150 total points
ID: 6361249
You tried this?

<table width="100%" bgcolor="#FFFFFF">

and it didn't work? I find that very hard to believe...
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:The_Brain
ID: 6363017
Well you see,

The whole page is fine, the CALENDAR pop up, is the problem. Sure the colour of the table works.  But the problem isn't that.  The calender's background is transparent, it has absolute position, (i.e. at the place where the edit box is).  And anything under the calendar... well shows up... I've edited tweaked everything about the calendar's div section, I could change part of the background (the text background which worked, but the most of it was still transparent) the selection and the headings, but it still had a generic background was still transparent.

 So nothing I do to the underlying Form, it's the calendar DIV that has a transparency background that wouldn't go away... =/

 Sorry if this is confusing, but I do html all day, and know the stuff, and this one really has me stumped >.<

 I'm probably overlooking something very stupid... but it's not those suggested things :(

(I'll try the last 2 after I get the calendar's machine online)


~Ixeus

0
 
LVL 19

Expert Comment

by:webwoman
ID: 6364764
FORM? If you've got a form under the popup, it's NOT going to go away, never is going to go away, and nothing you do to the div will hide it. Forms are ALWAYS on top. The only way you can have it not be on top is to surround that with a div and hide the entire form when you show the calendar.

Nothing else will do it.

If you had said that before, it would have made this a lot faster...
0
 
LVL 10

Expert Comment

by:dij8
ID: 6365342
And why will the form always be on top? Because they have a z-index of infinity.  And you can not change it.

If you do put the form in a div then you have to put the WHOLE form in the div and hide the WHOLE form because if you put some of it in a div (or any other form of layer) then in Netscape it will be separated from teh rest of the form.
0
 
LVL 1

Author Comment

by:The_Brain
ID: 6383775
Even though you didn't exactly give me the right answer in this case, you inspired me to look into more backgrounds,, I decided to rewrite this HUGE page into stylesheets and I style sheeted the calender and gave properties to TR of calendar and it works now :)
even with something like form under it.

Thx for the inspiration ;)

~Ixeus

(sorry no A, you didnt' provide an "Exellent!!!" answer :p)
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6384127
No problem... glad you got it to work!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Every business owner understands the significance of online customer reviews and the impact it can have on sales and revenues. With technology advancing at such a rapid pace, getting online reviews has never been easier, especially when many regions…
Read about the 3 stages of the buyer's journey: awareness, consideration, and decision.
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now