SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Bottom of Iframe.
-
Dec 23, 2003, 15:20 #1
- Join Date
- Mar 2002
- Location
- Cincinnati, Ohio
- Posts
- 45
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Bottom of Iframe.
Ok I have an iframe and I am adding content to this frame by doing document.write(). Ok After the page gets too big I want it to scroll to the bottom of the page. Is there anyway to make it scroll to the bottom of the iframe every time I add text using document.write()?
Thanks in advance!
-
Dec 23, 2003, 17:02 #2
- Join Date
- Sep 2002
- Location
- Bournemouth, South UK
- Posts
- 1,551
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
document.body.scrollTop=n+"px" where n>total iframe body height.
LiveScript: Putting the "Live" Back into JavaScript
if live output_as_javascript else output_as_html end if
-
Dec 23, 2003, 17:10 #3
- Join Date
- Dec 2003
- Location
- Melbourne, Australia
- Posts
- 66
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I stole this from a chat script that I wrote using two iframes. In the BODY tag I use this method
window.scrollTo( 0, 84728472 )
I'm not sure where I got the 84728472 from, but it was probably just a large enough number to always be beyond the size of my iframe. On IE this causes the frame to scroll to the bottom. This has to be called from inside the iFrame.
Cheers
Dave
-
Dec 23, 2003, 18:07 #4
- Join Date
- Mar 2002
- Location
- Cincinnati, Ohio
- Posts
- 45
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I already tried that. And it doesn't work... Any other ideas? I tried:
OnLoad="window.scrollTo( 0, 84728472 )"
-
Dec 23, 2003, 18:24 #5
- Join Date
- Mar 2002
- Location
- Cincinnati, Ohio
- Posts
- 45
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Markdidj
-
Dec 23, 2003, 18:34 #6
- Join Date
- Mar 2002
- Location
- Cincinnati, Ohio
- Posts
- 45
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I figured it out...
I just called a function on the iframes' window to make it goto the bottom using ScrollTo.
Thanks for the help!
-
Dec 25, 2003, 14:23 #7
- Join Date
- Sep 2002
- Location
- Bournemouth, South UK
- Posts
- 1,551
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by WhSox21
LiveScript: Putting the "Live" Back into JavaScript
if live output_as_javascript else output_as_html end if
Bookmarks