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
    May 2004
    Location
    Sydney, Australia
    Posts
    281
    Thanks
    0
    Thanked 0 Times in 0 Posts

    frames and scrolling

    using frames from my own chat and i use the top frame as the display window and the bottom frame as my input....

    can i force the top window to always scroll to the bottom so that the latest post is always shown after each refresh....

    the page can be seen here.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Change this in the chat.php

    <meta http-equiv="refresh" content="7" />

    to this:

    <meta http-equiv="refresh" content="7;chat.php#lastpost" />


    Then when chat.php generates the page, dynamically put an anchor in the last message.

    <a name="lastpost" id="laspost"></a>
    <b>sysop :</b>stripslashes()...<br />
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Regular Coder
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    281
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if i add this <a name="lastpost" id="laspost"></a> to every post how do i remove it from the previous one.....

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You are dynamically displaying the messages using php, right? So there must be a loop to display each line of messages. If you're in the last iteration of the loop, output that anchor before the last message.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Or you could print it after the loop:

    echo '<a name="bottom" id="bottom" />';
    CATdude about IE6: "All your box-model are belong to us"


  •  

    Posting Permissions

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