Div scrolling with the scroll bar
Last Update:2018-12-06
Source: Internet
Author: User
<Div id = divmenu style = "position: absolute; visibility: visible; Z-index: 1; top: 55px; left: 892px;">
<Table width = "66" Height = "341" border = "0" cellpadding = "0" cellspacing = "0">
<Tr>
<TD> enter the content here </TD>
</Tr>
</Table>
</Div>
<P>
<Script language = "JavaScript">
<! --
VaR bnetscape4plus = (navigator. appname = "Netscape" & navigator. appversion. substring (0, 1)> = "4 ");
VaR bexplorer4plus = (navigator. appname = "Microsoft Internet Explorer" & navigator. appversion. substring (0, 1)> = "4 ");
Function checkuielements (){
VaR ymenufrom, ymenuto, ybuttonfrom, ybuttonto, yoffset, timeoutnextcheck;
If (bnetscape4plus ){
Ymenufrom = Document ["divmenu"]. Top;
Ymenuto = top. pageyoffset + 90;
}
Else if (bexplorer4plus ){
Ymenufrom = parseint (divmenu. style. Top, 10 );
Ymenuto = Document. Body. scrolltop + 20;
If (ymenuto <90) {ymenuto = 90 ;}
}
Timeoutnextcheck = 90;
If (math. Abs (ybuttonfrom-(ymenuto + 0) <6 & ybuttonto <ybuttonfrom ){
SetTimeout ("checkuielements ()", timeoutnextcheck );
Return;
}
If (ybuttonfrom! = Ybuttonto ){
Yoffset = math. Ceil (math. Abs (ybuttonto-ybuttonfrom)/10 );
If (ybuttonto <ybuttonfrom)
Yoffset =-yoffset;
If (bnetscape4plus)
Document ["divlinkbutton"]. Top + = yoffset;
Else if (bexplorer4plus)
Divlinkbutton. style. Top = parseint (divlinkbutton. style. Top, 10) + yoffset;
Timeoutnextcheck = 10;
}
If (ymenufrom! = Ymenuto ){
Yoffset = math. Ceil (math. Abs (ymenuto-ymenufrom)/20 );
If (ymenuto <ymenufrom)
Yoffset =-yoffset;
If (bnetscape4plus)
Document ["divmenu"]. Top + = yoffset;
Else if (bexplorer4plus)
Divmenu. style. Top = parseint (divmenu. style. Top, 10) + yoffset;
Timeoutnextcheck = 10;
}
SetTimeout ("checkuielements ()", timeoutnextcheck );
}
Function onload ()
{
Var y;
If (top. frames. length)
If (bnetscape4plus ){
Document ["divmenu"]. Top = top. pageyoffset + 100;
Document ["divmenu"]. Visibility = "visible ";
}
Else if (bexplorer4plus ){
Divmenu. style. Top = Document. Body. scrolltop + 100;
Divmenu. style. Visibility = "visible ";
}
Checkuielements ();
Return true;
}
Onload ();
// -->
</SCRIPT>
</P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>
<P> & nbsp; </P>