I’m referring to an older post (http://www.sitepoint.com/forums/showthread.php?p=4132290#post4132290) - but the challenge at hand is having a div start off screen and then slide in…pushing the existing div slide to accommodate…issues arize as the screen size changes…
hey everyone thanks for this info - I spent DAYS scouring the web for an elegant solution… HOWEVER…If I have two divs - side by side - and I slide them to the right, IF the edge of the browser is ‘smaller’ than the width of the screen - the divs stack one on top of another - IS THERE A WAY TO prevent this!..
What I’m after - a left ‘nav’ area that starts off screen, if the user wants it - it appears, but pushes the content to the right - but regardless of the with of the screen (yes it ‘may’ result in horizontal scroll) I want BOTH divs to remain side-by-side.
here’s the code - you’ll see the issue if you make your browser slightly wider then the “B” box…then show the “A” box, it slides and wraps…ugh!
<script type=“text/javascript” language=“javascript”>
function slideIt(){
var slidingDiv = document.getElementById(“container”);
var stopPosition = 0;
if (parseInt(slidingDiv.style.left) < stopPosition ) {
slidingDiv.style.left = parseInt(slidingDiv.style.left) + 12 + “px”;
setTimeout(slideIt, 1);
}
}
function hideIt(){
var slidingDiv = document.getElementById(“container”);
var stopPosition = -200;
if (parseInt(slidingDiv.style.left) > stopPosition ) {
slidingDiv.style.left = parseInt(slidingDiv.style.left) - 12 + “px”;
setTimeout(hideIt, 1);
}
}
</script>
<div style="height:30px; background-color:#CCC; text-align:center; ">
HEADER
</div>
<div id=“bolt4-ui” style=“margin:auto; text-align:left; min-width:1024px; float:left;”>
<div id=“container” style="position:absolute; left:-200px; ">
<div id=“d1” style="float:left; width:200px; height:200px; background-color:#930; margin-right:15px; "><a href=“javascript:hideIt()”>Hide A</a><br />
<font size=“32”>A</font></div>
<div id=“d2” style=“float:left; height:200px; width:800px; background-color:#C99;” ><a href=“javascript:slideIt()”>Show A</a><br />
<font size=“32”>B</font></div>
</div>
</div>
<div style="height:30px; background-color:#CCC; text-align:center;clear:both; ">
FOOTER
</div>