Results 1 to 9 of 9

Thread: User-adjustable split screen

  1. #1
    Join Date
    Mar 2008
    Location
    VA - USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post User-adjustable split screen

    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>

  2. #2
    Join Date
    Mar 2008
    Location
    VA - USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

  3. #3
    Join Date
    Mar 2008
    Posts
    122
    Thanks
    17
    Thanked 5 Times in 5 Posts

    Default

    Cant u just use a frameset?. Cool idea though

  4. #4
    Join Date
    Mar 2008
    Location
    VA - USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Using a frameset leads to bookmarking problems, which is what led to a search for this functionality. We're using master pages, so with a header, footer and the left frame (navigation) pre-filled from the master page, bookmarks will be clean and will represent the right frame contents, which is exactly what we want.

  5. #5
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    This method is not working on any browser but IE as you said and here is a simple cross-browser alternative which is not 6 pages long

    http://dynamicdrive.com/forums/showthread.php?t=27750

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hmm... Yes, indeed. Do you have a test page for that script available, though?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by eredin View Post
    I wanted an adjustable width navigation menu area
    I wonder why you should want an adjustable navigation area. I would say that what the user wants (I think) is a menu that folds out on top of the window, without obliging him/her to adjust whatever part of the screen in order to see the menu items.
    But I may have misunderstood what you want to achieve.
    ---
    Arie Molendijk.

  8. #8
    Join Date
    Mar 2008
    Location
    VA - USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The short answer is "user requirements." If after explaining all the options, that's still what they want, then that's what they get.

    The fact is that the menu changes fairly regularly, and some of the links are user defined and quite long (in a will-not-wrap kind of way), so while the user wants a "static," yet relatively narrow, left-hand menu area, they also want the ability to slide the menu open further to be able to see the entire text of a link. Our users use IE exclusively, so this works great for us.

    I am hoping to see a test page for the cross browser script, though. I certainly prefer to implement more widely accepted solutions.

  9. #9
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    Quote Originally Posted by molendijk View Post
    I wonder why you should want an adjustable navigation area. I would say that what the user wants (I think) is a menu that folds out on top of the window, without obliging him/her to adjust whatever part of the screen in order to see the menu items.
    But I may have misunderstood what you want to achieve.
    ---
    Arie Molendijk.
    I think you have misunderstood This feature is needed in some cases. Not just for the menu, but also while splitting multiple contents.

    Quote Originally Posted by djr33 View Post
    Hmm... Yes, indeed. Do you have a test page for that script available, though?
    Of course I have It is included in the zip file but if you want a quick look you can also test it from here: http://amplio-vita.net/JSLib/demos/slider

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •