Hi-
I need to use self.scrollTo(x ,y) as the last action in a js function called
by a onClick event. It seems that the scrolling actually takes place, but
the document is then scrolling back to top when js code execution has ended.
In the following example I get this effect in IE6 with the third and fourth
calls, while the first two work fine.
-------------------------------------------------------------
<HTML><HEAD><TI TLE>scrollTo</TITLE>
<script language="JavaS cript" type="text/JavaScript">
<!--
function scrollit(s) { self.scrollTo(0 ,s) }
-->
</script>
</HEAD>
<BODY>
<FORM name=myForm><IN PUT onclick=self.sc rollTo(0,300) type=button
value=scroll_(w orks_fine)> </FORM>
<p onClick="self.s crollTo(0,300)" >scroll with event in paragraph
(works_fine)</p>
<p><a href="#" onClick="self.s crollTo(0,300)" >scroll on event onclick in
anchor (doesn't work)</a></p>
<p><a href="#" onClick="scroll it(300)">scroll on event onclick in anchor,
calling a js function (doesn't work)</a></p>
<p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7</p><p>8</p><p>9</p><p>1
0</p>
<p>11</p><p>12</p><p>13</p><p>14</p><p>15</p><p>16</p><p>17</p><p>18</p>
</BODY></HTML>
----------------------------------------------------------------------------
----------------------------------
Any help highly appreciated
peppeprof
I need to use self.scrollTo(x ,y) as the last action in a js function called
by a onClick event. It seems that the scrolling actually takes place, but
the document is then scrolling back to top when js code execution has ended.
In the following example I get this effect in IE6 with the third and fourth
calls, while the first two work fine.
-------------------------------------------------------------
<HTML><HEAD><TI TLE>scrollTo</TITLE>
<script language="JavaS cript" type="text/JavaScript">
<!--
function scrollit(s) { self.scrollTo(0 ,s) }
-->
</script>
</HEAD>
<BODY>
<FORM name=myForm><IN PUT onclick=self.sc rollTo(0,300) type=button
value=scroll_(w orks_fine)> </FORM>
<p onClick="self.s crollTo(0,300)" >scroll with event in paragraph
(works_fine)</p>
<p><a href="#" onClick="self.s crollTo(0,300)" >scroll on event onclick in
anchor (doesn't work)</a></p>
<p><a href="#" onClick="scroll it(300)">scroll on event onclick in anchor,
calling a js function (doesn't work)</a></p>
<p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7</p><p>8</p><p>9</p><p>1
0</p>
<p>11</p><p>12</p><p>13</p><p>14</p><p>15</p><p>16</p><p>17</p><p>18</p>
</BODY></HTML>
----------------------------------------------------------------------------
----------------------------------
Any help highly appreciated
peppeprof
Comment