1) CODE TITLE: User-adjustable split screen
2) AUTHOR NAME/NOTES: Bradley Davis
3) DESCRIPTION: I just wanted to split the screen. I wanted an adjustable width navigation menu area, and I couldn't find one anywhere that wasn't 6 pages of code or a third-party tool. It had to be easier - and it was. It is kind of a hack, but it works great in IE. FireFox hasn't implemented onDrag yet, but it degrades gracefully, the screen is still split, it just doesn't adjust.
- Black.png is simply a 1x1 image (one black pixel) - it's essential, but you'll have to create it yourself - a task worthy of MS Paint.
- The iframe src (navmenu.html) is whatever you want it to be (or leave it out if you want - the effect is still there).
- For full effect, put another full-size iframe in the content area.
Comments welcome. Enjoy!
4) CODE:
Code:<html> <head> <title>Split Demo</title> <script language="JavaScript"> loaded = false; function dragSplit(dragEvent){ if (loaded) eval("document.getElementById('leftDiv').width=Math.max(dragEvent.x-3,1)"); } </script> </head> <body style="margin: 0px;" onload="loaded=true;"> <table cellpadding=0 cellspacing=0 border=0 height=100% width=100%> <tr><td id="leftDiv" width=150px><iframe src ="navmenu.html" height="100%" width="100%"></iframe></td> <td width="4" onmouseover="style.cursor='w-resize';"><img src="black.png" width="4" height="100%" onDrag="dragSplit(event)"></td> <td>Content</td></tr> </table> </body> </html>



Reply With Quote




This feature is needed in some cases. Not just for the menu, but also while splitting multiple contents. 
Bookmarks