By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

Div Auto Scroll problem in IE

karthickkuchanur
100+
P: 156
Dear All,
Expand|Select|Wrap|Line Numbers
  1. <script>
  2.     function scroll() {
  3.     var div = document.getElementById("main");
  4.     var arrow = document.getElementById('arrowId').offsetTop-30;
  5.     div.scrollTop = arrow;
  6. }
  7. </script>
The above code is working fine in firefox but it not work in IE

in IE var div gives value of[OBJECT]
in IE var arrow gives value -31 even if remove 30 it will return 0 please help me
Dec 12 '09 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
If it's less than 0, scrollTop will be set to 0. See https://developer.mozilla.org/En/DOM/Element.scrollTop
Dec 12 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.