Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Scrolling Menu Help

Hello all. Please bare with me as i'm a graphic designer by trade and very rarely venture into any type of programming/coding/javascript etc.

I recently came across a javascript for a simple scrolling sidebar I wanted to use for a site I'm currently designing. I want to use it to have a small contact form scroll down the page as the visitors scrolls. I got the script to work fine, and I got the form to show up where I want it to, but as soon as you scroll down the page the form jumps to the top of the page and stays there. I need to have the form show up where it is now and stay in the same screen position as the visitor scrolls. I hope this makes sense.

Here is the current page I have it on so you can see what I mean;

http://www.dci-international.com/locations2.html

Here is the code I am using;

<SCRIPT LANGUAGE="JavaScript">
<!--
//[avnerc@fundtech.co.il]
function changePosition()
{
obj=document.getElementById("moshe");
obj.style.pixelTop=document.body.scrollTop;
}
//-->
</SCRIPT>
<style>
#moshe
{
position:absolute;
border:;
height:50px;
width:50px;
left:255px;
top:+650px;
}
</style>
</HEAD>

<BODY onscroll="changePosition()">
<Div id="moshe"><p class="style1"><strong>Contact Form</strong></p>
<form method="POST" action="contact.asp">
<table width="173" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" class="style1">Full Name</td>
</tr>
<tr>
<td align="left" class="style1"><input type="text" name="FullName"></td>
</tr>
<tr>
<td align="left" class="style1">Phone Number </td>
</tr>
<tr>
<td align="left" class="style1"><p>
<input type="text" name="PhoneNumber">
</p> </td>
</tr>
<tr>
<td align="left" class="style1">Email Address</td>
</tr>
<tr>
<td align="left"><input type="text" name="EmailAddress"></td>
</tr>
<tr>
<td align="left" class="style1">Location of Interest</td>
</tr>
<tr>
<td align="left"><input type="text" name="LocationofInterest"></td>
</tr>
<tr>
<td align="left"><input type="submit" name="submit" value="Submit"></td>
</tr>
</table>
</form></div>

Any help or suggestions would be greatly appreciated.
[2966 byte] By [SumOne] at [2007-11-11 7:51:39]
# 1 Re: Scrolling Menu Help
any ideas? anyone?
SumOne at 2007-11-11 23:34:59 >