d22552000 Posted December 25, 2007 Share Posted December 25, 2007 statica.style.top=currentpos+"px" statica.style.left=5+"px" When I put that in my script, it f***s up and says it expects an object at the "s" in "statica.style.top".. .. My full script is here: <script type="text/javascript" language="JavaScript1.2"> var speed=50 var currentpos=0 var statica=document.getElementById("asvesee"); function scrollwindow(){ if (document.all) currentpos=document.body.scrollTop+speed else currentpos=window.pageYOffset+speed window.scroll(0,currentpos) // I am trying to put statica movement HERE. } function startit(){ setInterval("scrollwindow()",50) } </script> <div id="asvesee" style="position:absolute; border:1px solid black; background-color: lightyellow; width: 425px;"> <a href="javascript:startit()">Auto-Scroll Progress</a><br /> Remember, you can close this page, and the upload will continue!<br /> Please email damon.underground@gmail.com with bugs and feedback. </div> This is a VERY simple script to auto-scroll the window, and doesn't quite work on all browsers, but I suck at javascript (as you can tell by my simple question) Please tell me why it won't work, and how to fix it. BTW: This error comes up in IE7. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 26, 2007 Share Posted December 26, 2007 try this: <script language="javascript"> var speed=50 var currentpos=0 var statica=document.getElementById("asvesee"); function scrollwindow(){ if (document.all) { currentpos = document.body.scrollTop + speed; } else { currentpos = window.pageYOffset + speed; } window.scroll(0,currentpos); // I am trying to put statica movement HERE. statica.style.top = currentpos +"px"; statica.style.left="5px"; } function startit(){ setInterval("scrollwindow()",50) } </script> <div id="asvesee" style="position:absolute; border:1px solid black; background-color: lightyellow; width: 425px;"> <a href="javascript:startit()">Auto-Scroll Progress</a><br /> Remember, you can close this page, and the upload will continue!<br /> Please email damon.underground@gmail.com with bugs and feedback. </div> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> Note: I did not test the above code in IE7; but it works fine in FF and IE6. Quote Link to comment Share on other sites More sharing options...
d22552000 Posted December 28, 2007 Author Share Posted December 28, 2007 but it says object required in IE7. AAAAARRRRRRRRRRRRRRRGGGGGGGGGGGGGHHHHHHHHHH I hate IE7, but my site needs to be crowse browser compatible Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 28, 2007 Share Posted December 28, 2007 try this: <script language="javascript"> var speed=50 var currentpos=0 var statica=document.getElementById("asvesee"); function scrollwindow(){ if (document.all) { currentpos = document.body.scrollTop + speed; } else { currentpos = window.pageYOffset + speed; } window.scroll(0,currentpos); // I am trying to put statica movement HERE. document.getElementById("asvesee").style.top = currentpos +"px"; document.getElementById("asvesee").style.left="5px"; } function startit(){ setInterval("scrollwindow()",50) } </script> <div id="asvesee" style="position:absolute; border:1px solid black; background-color: lightyellow; width: 425px;"> <a href="javascript:startit()">Auto-Scroll Progress</a><br /> Remember, you can close this page, and the upload will continue!<br /> Please email damon.underground@gmail.com with bugs and feedback. </div> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> Quote Link to comment Share on other sites More sharing options...
d22552000 Posted December 30, 2007 Author Share Posted December 30, 2007 Thankyou, it worked, but it was too jerky. So I had to resort to putting the dv in a frame at the top of the page >< Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 30, 2007 Share Posted December 30, 2007 sounds good to me Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.