Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Flesler's 'scrollTo' plugin problems - please help Jquery noob!

    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/.../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.

    Cheers
    G

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,951
    Thanks
    9
    Thanked 724 Times in 718 Posts
    Try swapping your scripts round so jQuery comes before the scrollTo plugin.

  • #3
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    G

  • #4
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,951
    Thanks
    9
    Thanked 724 Times in 718 Posts
    Yes, that's the problem.

    If you use Firebug for Firefox (and you should....) 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.

  • #5
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    gotcha, cheers. I do use Firebug as it goes 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 Thanks again man, G


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •