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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    San Francisco
    Posts
    455
    Thanks
    19
    Thanked 15 Times in 15 Posts

    How to open page with specific list item showing

    I have a client who wants to have a list of speakers, past, present, and future as part of a page. When one goes to the page he wants the list to scroll to whomever the current speaker is. Is this possible? If so, please point me in the right direction.

    I imagine that this list would be housed in a div with overflow auto, the current speaker would have an ID on the list item, and the body would have an onLoad function to do it.
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read. Groucho Marx

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do you want a dropdown list, or more of a ASP style listview.
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    San Francisco
    Posts
    455
    Thanks
    19
    Thanked 15 Times in 15 Posts
    You should always say 'thank you' or at least say 'please'

    The client wants to explore all options, so long as when you go to the area on the page with the speakers the current speaker is the first thing you see. The client envisions a little "Speakers" section on the page with an attractive vertical scrollbar. I don't want to do it in Flash because the client needs to be able to update the speakers. I'm not sure if frames are the way to go or if there is a simple javascript alternative that also allows a customizable scrollbar.
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read. Groucho Marx

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,522
    Thanks
    3
    Thanked 508 Times in 495 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    <!--
    
    function Sort(id,nme){
     var obj=document.getElementById(id);
     var ds=obj.childNodes;
     var ary=[];
     for (var zxc0=0;zxc0<ds.length;zxc0++){
      if (ds[zxc0].tagName=='DIV'&&!ds[zxc0].title.match(nme)){
       ary.push(ds[zxc0]);
      }
     }
     for (var zxc1=0;zxc1<ary.length;zxc1++){
      obj.removeChild(ary[zxc1]);
      obj.appendChild(ary[zxc1]);
     }
    }
    //-->
    </script></head>
    
    <body onload="Sort('Tst1','Harry');">
    <div id="Tst1"style="position:relative;overflow:auto;width:300px;height:200px;border:solid black 1px;" >
    <div title="Tom" style="position:relative;height:200px;border:solid black 1px;background-color:red;" >
    </div>
    <div title="Dick" style="position:relative;height:200px;border:solid black 1px;background-color:green;" >
    </div>
    <div title="Harry" style="position:relative;height:200px;border:solid black 1px;background-color:blue;" >
    </div>
    
    </div>
    <input type="button" name="" value="Tom" onclick="Sort('Tst1','Tom');" >
    <input type="button" name="" value="Dick" onclick="Sort('Tst1','Dick');" >
    <input type="button" name="" value="Harry" onclick="Sort('Tst1','Harry');" >
    </body>
    
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    San Francisco
    Posts
    455
    Thanks
    19
    Thanked 15 Times in 15 Posts

    Eureka!b

    Once again you come through, vwphillips. I would name my firstborn child after you, but I'm not planning to have any. I'll see if I can talk my brother into changing one of his kids' names.
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read. Groucho Marx


  •  

    Posting Permissions

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