JQUERY Scroll Page Load
- Started
- Last post
- 17 Responses
- Q01
Yo QBN x Web Whizzes
I have all my scrolling setup (localscroll x scrollto x jquery) working HORIZONTALLY. I would like on document ready for the page to scroll to a set div or anchor. So basically, as soon as your hit the site the page would zoom off to the right.
How would I go about this?
Thank you ever so much.
: )
- Nathan_Adams0
The ScrollTo plugin is what you're after. http://plugins.jquery.com/projec…
- And I obviously didn't read, as you already mentioned it *facepalm*Nathan_Adams
- univers0
$(document).ready(function(){})
:P
- fugged0
^
FYI $(function(){}); is shorthand for $(document).ready(function(){})
- Nathan_Adams0
Would it be better to do it on $(window).load(function () {})?
That way it will scroll across when everything is loaded, and not while images and what not are still loading.
- Q010
document load is what I'm really after — but... where do I tell it which anchor to scroll to in the code you've given me?
$(document).ready(function(){})
This is what I can't figure out. Thanks very much for the help so far.
- Q010
Anyone? I'm in tears here.
- univers0
$(document).ready(function() {
$('#id-of-parent-scrolling-conta... "fast");
});That should do it I believe. Never actually used the plug in before so I am assuming off a quick glance at the documentation.
- univers0
My iPad fucked up my typing. I got up to write it on my computer instead.
$(document).ready(function(){
$('#ID-of-Parent-Container-That...
});
- univers0
....wtf It is cutting the code off?
$(document).ready(function(){
$('#parent-id').slideTo($('#ID-S...
});#Parent-ID is the ID that is for the container of the content you are sliding.
#ID-Slide-To is the ID that you have on the element you want to slide to when the page loads.
- Stugoo0
basically
when everything is loaded, fire the function... you dont need to put it in a click.
so make it the last thing in the script
- Q010
UNIVERS.
Man of the week. Thank you. I don't mind about you repeated failed attempts. You deeeed it!
- Q010
I think the iPad failed you.
- Q010
On page load I wish to scroll horizontally to a div called 'projects'.
- Q010
Only gone and bloody well dun it ave'nt ya Stugoo. Leg. END.