Thread: scrolling <DIV>
View Single Post
  #9 (permalink)  
Old July 26th, 2004, 02:59 PM
anshul anshul is offline
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

var initpos, scroll, newpos, str;

function initScroll(menu) {
 str=eval('menu');
 initpos=parseInt(
  document.getElementById(str).style.top);
 }

function scrollMenu(menu) {
 scroll=parseInt(document.body.scrollTop);
 newpos=pos+scroll;
 str=eval('menu');
 document.getElementById(menu).style.top=newpos;
 str=eval('menu');
 setTimeout("stay(str)",100);
 }

now u just need2call functions externally

initScroll('scrollMenu');
scrollMenu('scrollMenu');

this is working in all browsers i use.
do few corrections, if i've typed hurrily.
code that i'd seen 2weeks before on internet is horrible- some 100 lines
Reply With Quote