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
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
Code:<script type="text/javascript"> window.onload = function(){ document.body.scrollTop = document.body.scrollHeight/4; document.body.scrollLeft = document.body.scrollWidth/4; }; </script>
Jeremy | jfein.net
thanks for the help, however this seems to have issues in IE & firefox
IE8 doesnt seem to respond
Last edited by ggalan; 01-11-2011 at 03:26 AM.
It works fine in Firefox, haven't tested in IE. What browser version and operating system are you using?
Jeremy | jfein.net
hmm, tried 64bit firefox (namoroka)
windows 7 64bit
http://www.howtocreate.co.uk/tutoria.../browserwindow
Last edited by ggalan; 01-11-2011 at 03:27 AM.
Hmm, works fine for me. The only issue with this script is that you have to play around with the /4 part :/
Jeremy | jfein.net
ggalan (01-11-2011)
ok, will keep at it
can you check ie8 on your machine w/ this link please
http://www.2020proj.com/
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.
Jeremy | jfein.net
Bookmarks