PDA

View Full Version : jquery scrollbar control



ggalan
01-10-2011, 10:49 PM
i have a very wide image on my landing page.
is it possible to use jquery or any JS command to have the page focus in on the center of the page when you arrive
so basically it would be as if the scrollbar was moved to about the middle of the page

Nile
01-11-2011, 01:16 AM
<script type="text/javascript">
window.onload = function(){
document.body.scrollTop = document.body.scrollHeight/4;
document.body.scrollLeft = document.body.scrollWidth/4;
};
</script>

ggalan
01-11-2011, 02:19 AM
thanks for the help, however this seems to have issues in IE & firefox
IE8 doesnt seem to respond

Nile
01-11-2011, 02:22 AM
It works fine in Firefox, haven't tested in IE. What browser version and operating system are you using?

ggalan
01-11-2011, 02:44 AM
hmm, tried 64bit firefox (namoroka)
windows 7 64bit

http://www.howtocreate.co.uk/tutoria.../browserwindow

Nile
01-11-2011, 03:01 AM
Hmm, works fine for me. The only issue with this script is that you have to play around with the /4 part :/

ggalan
01-11-2011, 03:25 AM
ok, will keep at it

Nile
01-11-2011, 03:26 AM
Tell me if you can't figure it out

ggalan
01-11-2011, 03:29 AM
can you check ie8 on your machine w/ this link please
http://www.2020proj.com/

Nile
01-11-2011, 03:37 AM
Yeah, I see the issue. This is a little confusing to me - I didn't test different sizes of the page when I uploaded my script I only tested one. Let me work on this tomorrow. Sorry about this.

cindylou
01-11-2011, 06:49 AM
have you tried using this one?

http://livepipe.net/control/scrollbar

although i've made some changes on the height and width when i used that...it depends on the size...