Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts

    Adaptive Layout w/JS

    http://www.alistapart.com/articles/switchymclayout/
    But without javascript.
    Code:
    greater than 800x600
    |maincontent||sidebar|
    |maincontent||sidebar|
    |maincontent||sidebar|
    |maincontent||sidebar|
    
    less than 800x600
    ---------------
    sidebarsidebar
    ---------------
    |maincontent|
    |maincontent|
    |maincontent|
    |maincontent|
    links? pretty sure the old wordpress.com layout did this.
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #2
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    I don't have a link for you, but I do have a comment. The technique is pretty cool, whether with JS or without, but wouldn't it compromise the usability of the site somewhat? I mean, if I was in the middle of reading an article and had to resize the browser window for whatever reason and the layout changed that dramatically, not only would I probably lose my place in the article, I might even think that I had somehow moved to a new webpage. Even if it's as simple as reorienting the navigation bar, it's changing the configuration of links people are used to on a more user-discretionary level than something like a full site redesign (where one would expect some usability changes).

    Just thoughts. I would like to know how to do it with pure CSS (if it's even possible).
    matt | design | blog

  • #3
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    I am not worried about people loosing their place in the article or not recognizing the site. the sidebar is say 150px wide when it is on the right so their article would only be shifted down 150px - not that much of a change.
    This is mainly for people with small resolutions. How many people go to 800x600 when they have a 19" monitor - not many.

    Thanks for the input though!

    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Kind of a cool idea...
    This works in FF3, IE7 and IE8. I know it won't in IE6 so I didn't even look.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    body {
    	background: #FC0;
    	text-align:center;
    	font: 12px "Comic Sans MS";
    }
    * {
    	margin: 0;
    	padding: 0;
    	border: none;
    }
    #container {
    	background: #6F9;
    	overflow: auto;
    }
    .wrap {
    	min-width: 150px;
    	max-width: 400px;
    	margin: 20px 5px;
    	border: #F00 2px solid;
    	float: left;
    	background: #fff;
    }
    </style>
    </head>
    <body>
        <div id="container">
            <div class="wrap">
                <p>
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                    aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                    sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                    nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                    duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                </p>
            <!--end wrap--></div>
            <div class="wrap">
                <p>
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                    aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                    sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                    nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                    duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                </p>
            <!--end wrap--></div>
            <div class="wrap">
                <p>
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                    aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                    sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                    nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                    duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                </p>
            <!--end wrap--></div>
        <!--end container--></div>
    </body>
    </html>
    A small point twodays, the content would drop the height of the left column, not the 150px width.
    Last edited by Excavator; 12-23-2008 at 06:05 PM.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    that is just pushing floats - no change of style/look
    but what if the container is a %
    content is say 70% and sidebar is 150px;

    more: http://www.colly.com/comments/redesi...h-based-layout (comments are good)
    Last edited by twodayslate; 12-23-2008 at 10:44 PM.
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #6
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    http://tugbucket.net/tests/adapt/adapt.html

    super quirky but, it's a start. Only tested in FF2 as it's well, quirky. To many drawbacks to take it too seriously yet.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #7
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    Quote Originally Posted by harbingerOTV View Post
    http://tugbucket.net/tests/adapt/adapt.html

    super quirky but, it's a start. Only tested in FF2 as it's well, quirky. To many drawbacks to take it too seriously yet.
    I don't see what that is trying to accomplish. please explain.
    w/FF3

    thanks!
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #8
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    alright. if you have your content first in the HTML order and then the sidebar, why would you ever want the sidebar content to come before your content? this is assuming that the side is navigation and superfluous information. What i was trying to achieve was something like content first. then navigation. then extras. with pure CSS it's going to be tough.

    If you want a fluid layout, design for it. If you want JS to handle some of the brunt of it, let it. I played for a bit and couldn't get what you wanted to go the way you wanted it to go with just CSS so take it as either a) i don't understand what you want or b) you don't
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #9
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    alright. thanks for the help anyway.
    peace.


    edit:// decided to use JS. As long as they still have CSS enabled the site looks fine.
    Last edited by twodayslate; 12-26-2008 at 06:22 AM.
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!


  •  

    Posting Permissions

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