Link to home
Start Free TrialLog in
Avatar of The_Brain
The_Brain

asked on

DIV overlapping... *calendar pop up*

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
Avatar of webwoman
webwoman

Give the div a background color. Or even easier, give the table in the div a background color. It can be white.
Avatar of The_Brain

ASKER

tried that @.@
didn't turn out as simple as that
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.

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.
ASKER CERTIFIED SOLUTION
Avatar of webwoman
webwoman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

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...
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.
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)
No problem... glad you got it to work!