On my page I have 3 <div> tags.
The first is my menu bar occupying 0 to 25px in height. This is fixed and will not scroll, as it should not.
The second is my main body, which can scroll because it is greater than the visible height of the screen. Starting at 25px from top.
The third <div> tag is a hidden rate table that I float in a fixed position to the top right of the screen at 25px from top. This will always be visible on the screen even when I have scrolled the main body down.
Problem: When I re-hide the rate table <div>, the main body <div> scrolls to the top. I would like for that <div> to stay in the position where it was when I displayed the rate table. How can I either prevent the scrolling or read the position of the main body and re-scroll to the desired location?
Menu Bar:
Main Body:
Hidden Rate Table:
The first is my menu bar occupying 0 to 25px in height. This is fixed and will not scroll, as it should not.
The second is my main body, which can scroll because it is greater than the visible height of the screen. Starting at 25px from top.
The third <div> tag is a hidden rate table that I float in a fixed position to the top right of the screen at 25px from top. This will always be visible on the screen even when I have scrolled the main body down.
Problem: When I re-hide the rate table <div>, the main body <div> scrolls to the top. I would like for that <div> to stay in the position where it was when I displayed the rate table. How can I either prevent the scrolling or read the position of the main body and re-scroll to the desired location?
Menu Bar:
Code:
<div id="MenuBar" nowrap="nowrap">
<-- style code for menu bar -->
#MenuBar {
position: fixed;
white-space: nowrap;
top: 0px;
left: 1px;
width: 99%;
background-color: #CCFFFF;
background-image:linear-gradient(to bottom, #CCFFFF 0%, White 100%);
color: black;
border: #0000FF solid 1px;
padding-left: 10px;
z-index: 150;
}
Code:
<div id="CMEAdminTop" style="width:95%;left:15px;white-space:nowrap;border:5px ridge #ff6600;padding:7px;background-color: #ccffcc;background-image:linear-gradient(to top, #ccff99 0%, White 100%);">
<-- additional style info for main body -->
#CMEAdminTop {
position: absolute;
white-space: nowrap;
left: 0%;
top: 25px;
width: 99%;
color: #333333;
padding:5px;
font-size: 10pt;
overflow: hidden;
z-index: 98;
}
Code:
<div id="ratesDiv" style=" position:fixed; border:5px ridge #006600; top :25; left:250; height:300; width:700px; overflow: scroll; background-color: #ccffcc; background-image:linear-gradient(to top, #ccff00 0%, White 100%); z-index:99; visibility: hidden; " >
Comment