View Full Version : jQuery Flesler's 'scrollTo' plugin problems - please help Jquery noob!

12-02-2010, 04:16 PM
Hi there,

I'm new to jquery but not new to web design - I like to think I know my way round HTML, CSS and Wordpress development well, and that I can pick up Jquery without too much trouble.

I am trying out my first jquery website but am having real trouble implementing Ariel Flesler's scrollTo plugin (http://demos.flesler.com/jquery/scrollTo/). I have read a similar thread from back in 2009 on this forum saying with similar issues: http://www.codingforums.com/archive/index.php/t-149305.html

I have tried the solution suggested by 'kempobot' in this thread but to no avail. It seems that lots of people have had trouble trying to get it to work, so hopefully I'm being a complete tool!

If you think you might be able to help please check out the test page I have made... http://test.bantamstudio.com/test/

The basic idea of the website is to have all of the content (a portfolio) on one page and when the various links in the navigation are click the page makes an animated scroll to the relevant div. Very simple, but I simply can;t figure out how to use this plugin and have been trying for over a day now!

I haven't seen any discussion about the plugin dated within 2010, so perhaps a better solution for this function has come about, any suggestions?

Many thanks for your time, any help greatly appreciated.


12-02-2010, 04:40 PM
Try swapping your scripts round so jQuery comes before the scrollTo plugin.

12-02-2010, 05:10 PM
SB65 you are a STAR! Thank you so much!

So it turns out I was being a complete tool! I was certain I had done it by the book so couldn't figure out why it wasn't working.

Out of interest what is the reasoning behind it not working when the call to jquery is after the call to scrollto. Does the browser load scrollto first and then finds that it doesn;t work because the jquery library hasn't yet loaded?

Massive thanks again

12-02-2010, 05:12 PM
Yes, that's the problem.

If you use Firebug for Firefox (and you should....:D) then your previous page throws a console error "jQuery is not defined" - which is a clue that there's something wrong with your jQuery - either it hasn't loaded at all, or it's loaded after the plugin.

12-02-2010, 05:15 PM
gotcha, cheers. I do use Firebug as it goes :D but didn't know what the console bit was for (OOOOOPS!) - was going by the Firefox Error Console which didn't mention it.

I'll know where to look next time now :D Thanks again man, G