What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » better solution for window.scrollTo(x,y), onload is too slow.

Pages: (3): « First [ 1 ] 2 3 » Last »
better solution for window.scrollTo(x,y), onload is too slow.
Author: Message:
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. better solution for window.scrollTo(x,y), onload is too slow.
Currently im using:
<body onload='window.scrollTo(6,112)'>

but onload only activates when the whole page is loaded which might take a long time since the page has a lot of content.

how do i make the window.scrollto happen as soon as that part of the code is loaded?
09-14-2008 06:55 AM
Profile PM Web Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: better solution for window.scrollTo(x,y), onload is too slow.
you could always put it in <script> at the end of the page... but other than that you would have to wait until the whole page has loaded unless you know that 6,112 has loaded and is able to scroll there...
09-14-2008 07:17 AM
Profile PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: better solution for window.scrollTo(x,y), onload is too slow.
Remove other content from page. Scroll to 6,112. Load other content using js/ajax?

Get what I mean?
09-14-2008 07:40 AM
Profile E-Mail PM Web Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: better solution for window.scrollTo(x,y), onload is too slow.
put <script type="text/javascript">window.scrollTo(6,112);</script> into the HTML at the place that you know is approximately the location of (6, 112).

This post was edited on 09-14-2008 at 10:47 AM by segosa.
The previous sentence is false. The following sentence is true.
09-14-2008 10:46 AM
Profile PM Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: better solution for window.scrollTo(x,y), onload is too slow.
Use jquery, and there is the document.ready function, which executes whatever is in it as soon as the headers are requested.
Touch Innovation - touch friendly programs/applications for the windows mobile!


09-14-2008 11:41 AM
Profile E-Mail PM Web Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: RE: better solution for window.scrollTo(x,y), onload is too slow.
quote:
Originally posted by Nathan
Use jquery, and there is the document.ready function, which executes whatever is in it as soon as the headers are requested.

It executes on DOMContentLoaded i.e., when the page's source code has been downloaded and the DOM can be manipulated - meaning images may not be loaded yet.

As far as I'm aware window.onload and co only execute once images have been loaded too.

http://docs.jquery.com/Events/ready

Edit: oh, and it's $.ready.

This post was edited on 09-14-2008 at 11:48 AM by segosa.
The previous sentence is false. The following sentence is true.
09-14-2008 11:47 AM
Profile PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: better solution for window.scrollTo(x,y), onload is too slow.
quote:
Originally posted by segosa
put <script type="text/javascript">window.scrollTo(6,112);</script> into the HTML at the place that you know is approximately the location of (6, 112).
Woah... didn't know this could be done in such a way. I always thought JavaScript was executed after the page loaded itself.
09-14-2008 11:57 AM
Profile E-Mail PM Web Find Quote Report
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. RE: better solution for window.scrollTo(x,y), onload is too slow.
what do i do if this page is basically an iframe of another site.
where would i go about putting the <script type="text/javascript">window.scrollTo(6,112);</script>

if the iframe is the only code on the page basically.
09-14-2008 12:54 PM
Profile PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: better solution for window.scrollTo(x,y), onload is too slow.
quote:
Originally posted by .Roy
if the iframe is the only code on the page basically.
Put the code in page that is the source of the iframe? If you pull that from some other site you don't have access to... get a php script to pull the code, edit it and put the js and then display it.
09-14-2008 12:56 PM
Profile E-Mail PM Web Find Quote Report
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. RE: better solution for window.scrollTo(x,y), onload is too slow.
quote:
Originally posted by Felu
quote:
Originally posted by .Roy
if the iframe is the only code on the page basically.
Put the code in page that is the source of the iframe? If you pull that from some other site you don't have access to... get a php script to pull the code, edit it and put the js and then display it.
yes the code is from an external website and if i pull the code it won't work because whatever i'm trying to get from thier site only works on their site.

(tested by copying source onto html document and it didn't work)

any other solutions?

this is the page btw:
http://www.zomganime.com/mv.php?id=LG0NA8O6
im kind of using 2 iframes to get only the player:

http://www.zomganime.com/code-geass-lelouch-of-th...ion-r2-episode-23/
(look at the bottom video on that page)

but sometimes it takes too long and you can see the megavideo logo so yeah...

This post was edited on 09-14-2008 at 01:04 PM by .Roy.
09-14-2008 01:02 PM
Profile PM Web Find Quote Report
Pages: (3): « First [ 1 ] 2 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On