Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] innerwidth
- From: javascript@xxxxxxxxxx (Andrew Dunn)
- Subject: [Javascript] innerwidth
- Date: Fri, 24 May 2002 12:57:32 +1000
I have tried this code but it says "innerHeight is undefined", I forgot to mention that this window is a frame would this make any difference? Thanks. -----Original Message----- From: J. Lester Novros II [mailto:lester@xxxxxxxxxxx] Sent: Friday, 24 May 2002 12:05 PM To: javascript@xxxxxxxxxx Subject: Re: [Javascript] innerwidth Dear Andrew, On 05/24/2002 03:09 AM, Andrew Dunn wrote: > Hi, > I have a loop as follows, which scrolls to the end of the page slowly: > > function startScrolling () > { > window.scrollBy(1,0); This statement would scroll the page horizontally; 'scrollBy(0, 1);' would scroll vertically. > When the browser gets to the end of the page I want it to go back to > the beginning, but I can't figure out how to do it. I thought about > using innerWidth and a counter (i) but I can't get the innerWidth to > work: here is a link to the page: Try doing it this way: function startScrolling() { window.scrollBy(0, 1); if ((innerHeight + pageYOffset) < document.body.offsetHeight) setTimeout ('startScrolling()', 60); else window.scrollTo(0, 0); } 'pageYOffset' returns the amount that the page has been scrolled vertically, i.e. the distance between the document top and the top of the canvas a.k.a. client area; 'innerHeight' is the height of the canvas. Hope this helps. l8R lES -- Since 1998, a federal judge ordered a breakup, an appeals court threw out that order, and a new judge took responsibility; yet even with 2 courts finding that m$ violated the Antitrust Act, no remedy has been put into effect. cNet News http://open.denhaag.nu http://www.denhaag.org _______________________________________________ Javascript mailing list Javascript@xxxxxxxxxx https://lists.LaTech.edu/mailman/listinfo/javascript
- Follow-Ups:
- [Javascript] innerwidth
- From: J. Lester Novros II
- [Javascript] innerwidth
- Prev by Date: [Javascript] innerwidth
- Next by Date: [Javascript] innerwidth
- Previous by thread: [Javascript] innerwidth
- Next by thread: [Javascript] innerwidth
- Index(es):