-
hello
got this script that scrolls (well jumps actually) to the extreme right of a wide page as soon as the page loads
so in my onload i have
onload="javascript:start()"
and the script called is the following
function start()
{
parent.frames["left"].scroll(2992,0);
}
very simple, works fine in Explorer, but no go in netscape, i know the scroll works because i have buttons that scroll to certan parts of the page and they work fine, so cant figure it out whether its the onload or what?
if anyone has any ideas please let me know
Sincerely
Garrett Lynch
http://www.asquare.org/
-
Two suggestions (although untested):
1) Use document.parent.frames instead of just parent.frames -
Netscape can be picky about this.
2) Instead of using an onLoad, call the script just before you close your </html> tag...
<script language="JavaScript">
<!--
start();
// -->
</script>
</html>
-
different positions
no nether made any difference
i tried the scroller again and discovered it is actually jumping to the position however in netscape the position is not at all the same one as in explorer
for example in netscape
parent.frames["left"].scroll(2620,0);
works
however in explorer
parent.frames["left"].scroll(2992,0);
is the same position
makes no sense, dont want to have to script around each browser, cos i'm sure its going to be different again in nestscape 6 and i need to get it working in icab too.
so if you have an idea whay its doing this let me know as i'm stuck
later
Garrett Lynch
-
this could be just the way you typed it, and I doubt that it is causign this effect, but javascript needs to be all one word.
You have:
onload="java script:start()"
and it should be:
onload="javascript:start()"
-
mmm yep thats very confusing you've typed exactly the same thing twice! but yes i know what you mean and that was just my typo at the start, no its not that cos as i said it works just the huge difference in the jump to point well read my last post because i said all there
later
Garrett Lynch
-
ah...I just rememberd. Sitepoint breaks up the word javascript when it begins with an even handler to prevent hacking...
so I could do this:
javascript
and it should not have a space. But when I do this:
onload="javascript:SomeFunction();"
it will put a space in the word javascript.
Pretty clever SitePoint guys.