SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Location
    Marmaris, Turkey
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Floating SSI vertical menu

    Hello everyone:

    I haven't really got a clue about what I'm doing but I do know what I am trying to do.

    I have a vertical menu which uses SSI.

    A friend complained about the menu staying at the top of the page especially when it is a very long page so I have tried to use a script that floats the menu in the left column.

    I will insert some of the code which I found on a site which achieves the aim except that the nav table does not start at the top of the column.

    This is a link to a normal page which could use a floating nav table:
    http://www.allaboutmarmaris.com/All_...20Turkey.shtml

    This is the link to the trial page:
    http://www.allaboutmarmaris.com/Temp...floating.shtml

    Below is part of the applicable code copied from the page:
    Quote:

    <div id="l-col" align="center"><script>
    if (!document.layers)
    document.write('<div id="divStayTopLeft" style="position:absolute">')
    </script>

    <layer id="divStayTopLeft">

    <div id="l-col" align="center"><!--#include virtual="../CSS_Folder/menuv.htm"--></div>

    </layer>


    <script type="text/javascript">

    /*
    Floating Menu script- Roy Whittle (http://www.javascript-fx.com/)
    Script featured on/available at http://www.dynamicdrive.com/
    This notice must stay intact for use
    */

    //Enter "frombottom" or "fromtop"
    var verticalpos="fromtop"

    if (!document.layers)
    document.write('</div>')

    function JSFX_FloatTopDiv()
    {
    var startX = 3,
    startY = 150;
    var ns = (navigator.appName.indexOf("Netscape") != -1);
    var d = document;
    function ml(id)
    {
    var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
    if(d.layers)el.style=el;
    el.sP=function(x,y){this.style.left=x;this.style.top=y;};
    el.x = startX;
    if (verticalpos=="fromtop")
    el.y = startY;
    else{
    el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
    el.y -= startY;
    }
    return el;
    }
    window.stayTopLeft=function()
    {
    if (verticalpos=="fromtop"){
    var pY = ns ? pageYOffset : document.body.scrollTop;
    ftlObj.y += (pY + startY - ftlObj.y)/8;
    }
    else{
    var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
    ftlObj.y += (pY - startY - ftlObj.y)/8;
    }
    ftlObj.sP(ftlObj.x, ftlObj.y);
    setTimeout("stayTopLeft()", 10);
    }
    ftlObj = ml("divStayTopLeft");
    stayTopLeft();
    }
    JSFX_FloatTopDiv();
    </script>

    Unquote

    Would the answer have something to do the startY = 150

    Cheers and thanks

    Jack
    The Magus

  2. #2
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seriously, I wouldn't do that. Instead, what about using a Totop anchor link every so often (at the end of a paragraph), so that it takes the viewer back to the top of the page.

    PS: Have you checked your page in Firefox and IE6... a few problems with the rendering of the page I'm afraid.

    Nadia

  3. #3
    SitePoint Member
    Join Date
    Nov 2006
    Location
    Marmaris, Turkey
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good morning Nadia P:

    Yes, I have checked my pages in IE 5, 6, 7 and FF without noticing anything unusal. Could you point out what you notice wrong with the pages??

    Cheers

    Jack

  4. #4
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It may very well be the pc I'm right now, but in IE6, the text is really huge and the content area doesn't start on the right hand side until the menu finishes... I'll double check when I get home and post some snapshots if I still see the same problem. In Firefox, I'm seeing the text butting right up to the picture you have in the content area - you need a bit of padding between the text and the pic.

    Nadia

  5. #5
    SitePoint Member
    Join Date
    Nov 2006
    Location
    Marmaris, Turkey
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Nadia P:

    I assume you are referring to the All About Turkey page link I quoted in the original post - http://www.allaboutmarmaris.com/All_...20Turkey.shtml.

    It appears ok on my machine but I will put a bit of space above and below the image but otherwise it seems okay. I am sure this must be everyone's nightmare but this page checks out in all the versions of IE that I have except IE 4 where is hugs the left side of the page.

    Thanks for your interest.

    Jack
    The Magus

  6. #6
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jack,
    Checking on my own pc, there is *no* problem with viewing the page in IE6 - so apologies for possibly alarming you :-)

    Now I have no idea as to why the other pc using IE6 showed such large text... size is set to medium, so there must be something else in the settings on that machine.

    That aside, I still believe you don't need to do that moving menu thing - if you don't want to use back to top anchor links, then maybe break up the page into smaller chunks and link to separate small pages.

    Nadia

  7. #7
    SitePoint Member
    Join Date
    Nov 2006
    Location
    Marmaris, Turkey
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Nadia P:

    Thanks for the confirmation that it appears ok on another machine.

    I think I will forget about this idea as my partner has just voiced her opinion/order/dictate and said she didn't like it even if it worked the way I wanted it to. Sometimes she saves me from myself.

    I wanted to use it on several of the index pages connected with the property pages but it will be much simpler just to open the space between a few of the listings and insert an anchor as you suggest with a link back to the top of the page. Simplicity is sometimes best in the end.

    Thanks for your interest and advice.

    Cheers

    Jack
    The Magus


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
  •