Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
permabanned Arf
May 29, 2001

by Ozma
Got an issue with firefox, or more likely with Opera and IE being forgiving with my retarded code.

Just trying to scroll a div vertically. I've got the content div nested within another container div with overflow:hidden; set, and I'm using this basic function to scroll the div up:

code:
var pos = 270
function Scroll() {
    obj = document.getElementById('scrollerdiv');
    pos -= 1;
    obj.style.top=pos;
    window.setTimeout("Scroll();",50);
}
window.onLoad = Scroll();
I haven't added in anything to stop the div scrolling yet but I'll just add in an if statement. Anyway this all works just as I'd like in Opera and IE, but in Firefox the div stays hidden, until a certain amount of time passes and it appears, static. If I change the delay on the setTimeout to a lower value, or lower the position variable it appears quicker, so its running the function fine, but it doesn't look like its redrawing the div until the reaches the top of the container when it stops (which is not how i want it to behave anyway).

Any help would be awesome.

Adbot
ADBOT LOVES YOU

permabanned Arf
May 29, 2001

by Ozma
Thanks for your help, turns out it was the pixel thing. Also taken on board your comments about form. Don't worry, this is not going anywhere near anything important.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply