umekille78 Posted March 14, 2006 Share Posted March 14, 2006 Hi all!I hope you dont get too borde with me.The other day I got a script from some one here. And I use it in my page. <script>function scrollit(){window.scroll(0,screen.height);}</SCRIPT> The script is scrolling down a iframe for me. Every time the iframe is reloaded the script scrolls it to the end.This worked fine and I was happy But after a while the text in the iframe was geting long and the script didnt scroll it down to the end any more. It stopped after a while.Is the screen.height a integer value? And so is it becouse the text in the iframe have more rows than that size?The script still scrolls down. But only to a sertan point. Not all the way down.If screen.height is a integer. Can I putt a larger integer in its place to get the efect i want? And if so. What is the biggest integer you can use in a java script?Or can you fix the problem in another way?/Per Link to comment Share on other sites More sharing options...
scott100 Posted March 14, 2006 Share Posted March 14, 2006 (edited) Well noticed screen.height gives the screen size ie 1024x768 not document lengthQuick workaround = window.scroll(0,screen.height*100000);I am trying to see if there is a document.height or something. Edited March 14, 2006 by scott100 Link to comment Share on other sites More sharing options...
aspnetguy Posted March 14, 2006 Share Posted March 14, 2006 I believe for IE this gives you the document height window.event.clientY + document.scrollTop FireFox is a bit tricky...I'll see if I can find it. Link to comment Share on other sites More sharing options...
scott100 Posted March 14, 2006 Share Posted March 14, 2006 Ok found it, tested and works on the 3 main browsers window.scroll(0,document.body.scrollHeight); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now