Goes down with the page

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
cbrian
Forum Commoner
Posts: 97
Joined: Sun Feb 27, 2005 12:29 pm

Goes down with the page

Post by cbrian »

There is a sidebar on the left that goes down with the page. As in, if the page content requires you to scroll down a bit to read all of it, the sidebar will appear lower than it should. How can I make it always stay at the top?

Code: Select all

<script language=javascript>
function focuz() {
document.form.message.focus();
}
function insert(pusername) {
document.form.message.value = &quote;/msg &quote; + pusername + &quote; &quote;;
}
</script>
<html>
<head>
<title>Kingdom of Dragons</title>
<link rel=&quote;stylesheet&quote; type=&quote;text/css&quote;
href=&quote;style.css&quote;> 
</head>
<body background=&quote;images/greyscale.png&quote; leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td height=50 background=&quote;images/Header01.jpg&quote; cellpadding=0 cellspacing=0 align=center bgcolor=black colspan=20 width=100%>
<!-- BANNER -->
</td>
</tr>

<tr>
<td width=6% rowspan=4 valign=top>
&nbsp;
</td>
<td width=20%> <!-- ID 1 -->
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td height=30>&nbsp</td>
</tr>

<tr>
<td style=&quote;color: white;&quote; width=200 cellspacing=0 cellpadding=0 bgcolor=blue>
<div align=center><b>Char Info</b></div>
</td>
</tr>

<tr>

<td valign=top width=200 style=&quote;padding:5px;border: 1px solid blue;&quote; cellpadding=0 cellspacing=0>  <!-- ID 1 -->
<!-- ^Table = Navigation Table -->
<div align=left> <!-- ID 2 -->
<b>cbrian</b>&#1111;1] <br><b>Level:</b> 1<br><b>Health:</b> 0/20 <br><table height=4 style=&quote;border:1px solid black;&quote; cellspacing=0 cellpadding=0 width=100><td bgcolor=&quote;#80FA80&quote; width=&quote;0&quote;></td><td bgcolor=&quote;blue&quote; width=&quote;100&quote;></td></table><b>Energy:</b> 15/100 <br><table height=4 style=&quote;border:1px solid black;&quote; cellspacing=0 cellpadding=0 width=100><td bgcolor=&quote;#80FA80&quote; width=&quote;15%&quote;></td><td bgcolor=&quote;blue&quote; width=&quote;85%&quote;></td></table><b>Gold:</b> 545 <br><b>Bank:</b> 0 <br><b>Credits:</b> 0 <br></div>  <!-- END ID 2 -->

</td>  <!-- END ID 1 -->

</tr>
</table>
<table><td height=30></td></table> <!-- Divides navbar1 and navbar2 -->

<table valign=top border=0 cellspacing=0 cellpadding=0 border=0>
<tr>
<td style=&quote;color: white;&quote; width=200 cellspacing=0 cellpadding=0 bgcolor=blue>
<div align=center><b>Navigation</b></div>
</td>
</tr>
<tr>
<td valign=top rowspan=2 width=200 style=&quote;padding:5px;border: 1px solid blue;&quote; cellpadding=0 cellspacing=0>  <!-- ID 3 -->
<div class=&quote;nav&quote; align=&quote;left&quote; valign=top> <!-- ID 4 -->
- <a href=&quote;game.php?where=den&stamp=1112402372&quote; style=&quote;color:green&quote;>Den &#1111;0]</a><br>- <a href=&quote;game.php?where=town&stamp=1112402372&quote; style=&quote;color:green&quote;>Town</a><br>- <a href=&quote;game.php?where=healer&stamp=1112402372&quote; style=&quote;color:green&quote;>Healer's Hut</a><br>- <a href=&quote;game.php?where=fight&stamp=1112402372&quote; style=&quote;color:green&quote;>Fight</a><br>- <a href=&quote;game.php?where=bank&stamp=1112402372&quote; style=&quote;color:green&quote;>Bank</a><br>- <a href=&quote;game.php?where=messenger&stamp=1112402372&quote; style=&quote;color:green&quote;>Messenger &#1111;0]</a><br>- <a href=&quote;game.php?where=chat&stamp=1112402372&quote; style=&quote;color:green&quote;>Chat &#1111;0]</a><br>- <a href=&quote;game.php?where=forum&stamp=1112402372&quote; style=&quote;color:green&quote;>Forum</a><br>- <a href=&quote;game.php?where=beta&stamp=1112402372&quote; style=&quote;color:red&quote;>Beta Tester Info <b>!!!</b></a><br>- <a href=&quote;game.php?where=den&stamp=1112402372&logout=yes&quote; style=&quote;color:green&quote;>Logout</a><br>- <a href=&quote;game.php?where=refill&stamp=1112402372&quote; style=&quote;color:red&quote;>Refill Energy</a><br></div> <!-- END ID 4 -->
</td> <!-- END ID 3 -->
</tr>
</tr>

<table><td height=30></td></table>

<table cellspacing=0 cellpadding=0 border=0>
<tr>

<td style=&quote;color:white;&quote; width=200 cellspacing=0 cellpadding=0 bgcolor=blue>
<div align=center><b>Account</b></div>
</td>
</tr>
<tr>

<td width=200 valign=top style=&quote;padding:5px;border:1px solid blue;&quote; cellpadding=0 cellspacing=0>
<div align=&quote;left&quote; valign=top class=&quote;nav&quote;>
- <a href=&quote;game.php?where=account&stamp=1112402372&quote; style=&quote;color:green&quote;>Account</a><br>- <a href=&quote;game.php?where=preferences&stamp=1112402372&quote; style=&quote;color:green&quote;>Preferences</a><br></div>
</td>
</tr>
</table>

<table><td height=30></td></table> <!-- SEPERATOR -->

<table valign=top border=0 cellspacing=0 cellpadding=0>
<tr>
<td style=&quote;color:white;&quote; width=200 cellspacing=0 cellpadding=0 bgcolor=blue>
<div align=center><b>Info</b></div>
</td>
</tr>
<tr>
<td valign=top width=200 style=&quote;padding:5px;border:1px solid blue;&quote; cellpadding=0 cellspacing=0>
<div align=&quote;left&quote; class=&quote;nav&quote; valign=top>
<b>Game time</b><br>4/01 7:24:32 PM <br><br>Online players: <a href=&quote;game.php?where=online_players&stamp=1112402372&quote; style=&quote;color:green&quote;>1</a><br></div>
</td>
</tr>
</table>













</td> <!-- END ID 1 -->
<td rowspan=4 width=&quote;4%&quote;>&nbsp</td>
<td rowspan=4 width=&quote;67%&quote; valign=top>
<br><br><br>
fight</tr><table width=100% cellspacing=0 cellpadding=0>
<tr>
<td height=30></td>
</tr>
<tr bgcolor=F3F3F3 width=100%>
<td colspan=3 width=100%>

<div align=center>
<font color=gray>&#1111; <a href=&quote;http://www.cbc.stlawrencechurch.us/KoD/index.php&quote; style=&quote;color: gray;&quote;>Home</a> | <a href=&quote;http://www.cbc.stlawrencechurch.us/KoD/tos.php&quote; style=&quote;color: gray;&quote;>Terms of Service</a> | <a href=&quote;http://www.cbc.stlawrencechurch.us/KoD/contact.php&quote; style=&quote;color: gray;&quote;>Contact</a> ]
<br>
Copyright &copy 2005 Brian Heberling. All Rights Reserved.<br>

Page loaded in 0.958575 seconds.</font>
</div>
</td></tr>
</table>
</table>
</body></html>
josh-j
Forum Newbie
Posts: 4
Joined: Thu May 12, 2005 8:49 pm
Location: melbourne, australia

Post by josh-j »

cbrian,

just to clarify,

1. The sidebar's vertical position is being dynamically updated (with javascript) when the user scrolls the page. And you want to change this so it stays put. Is that right?

2. Where is that sidebar in the code you posted? Is is labelled, or have an id or something?

Might be able to help you if we clear that up first...
cbrian
Forum Commoner
Posts: 97
Joined: Sun Feb 27, 2005 12:29 pm

Post by cbrian »

Sorry, I forgot to edit the post. I fixed it.
Post Reply