I am using scrollTo(x,y) function in my web application and function is not working in IE. But it is working with firefox. I'm using IE6. So can someone give me the reason and how to use scrollTo function with IE?

I am using scrollTo(x,y) function in my web application and function is not working in IE. But it is working with firefox. I'm using IE6. So can someone give me the reason and how to use scrollTo function with IE?

<html>
<body>
<script language="JavaScript">
function function1(){
    window.scrollTo(200,200);
}
function function2(){
    window.scroll(200,200);
}
</script>
<input type="button" value="Scroll to (200,200)" onClick="function1();">
<input type="button" value="Scroll(200,200)" onClick="function2();">
<div style="height:1000;width:1500;background-color:blue;"></div>
</body>
</html>

this code is working in IE and FF, got it off the net

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.