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 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Exclamation Struggling with ScrollTo script

    Help. I was wondering if anyone could help with implementing Ariel Flesler's JQuery "ScrollTo" script. Great script but the instructions aren't friendly for JavaScript beginners.

    • Original script is here
    • Stripped down version of my page is here.
    • This is what the link looks like that evokes the script:

    Code:
    <a onclick="$.scrollTo( '#C5', 2000, {queue:true}, {axis:'xy'}, {easing:'swing'} );" href="#">MyLink</a>

    Aims:
    I need to queue the x-axis and y-axis motion. Some links need to scroll first x, then y, others will do the opposite. I'm having trouble with three things:


    • The x/y axis separation seems to only go x, then y, but not the other way round.
    • Even when it only scrolls on one axis, there is a rapid flash that happens just as the scrolling starts. It seems to try follow the "#" href before the script starts.
    • Sometimes if I click a link and then click another one too quickly, it scrolls off to the wrong place.
    • I included this JQuery easing script from this website, but can't seem to evoke the specific easing options, despite defining them in the above mentioned link structure.

    There's probably something really silly that I missed. Any help would be hugely appreciated! (I'm using Firefox V3.6.15 on Windows7)

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    if you find a solution post here please. I'm interested in this, i tried the demo, ffox 3.5.16 on linux, and didn't work for me.

    best regards

  • #3
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Sputnik1, your link to your code is pointing at the original download page, not your own page.

    Demo on that page works fine for me on FF3/Win XP.

  • #4
    New Coder
    Join Date
    Feb 2011
    Posts
    29
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Hey,
    I was trying to make that code to work at some point also but eventually I gave up. I am a beginner also, but I got it done with JScroll.

    Here is the demo page:
    http://jscrollpane.kelvinluck.com/sc...o_animate.html

    Have a look and see if you can adapt this to your needs.

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Have you considered the simple JavaScript native scrollIntoView() method?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Smile Maybe this will help

    Thanks for the response everyone.

    Oesxyl, I found post #15 useful on this page though I'm still having problems getting the custom variables to work.

    Sorry SB65, I accidentally posted the wrong link. Here is my demo page:
    http://www.gaelen.co.za/test1

    Thanks Alexa and Kor, I will try your suggestions.
    Last edited by Sputnik1; 03-15-2011 at 11:33 PM. Reason: I didn't see later responses and decided to writ a reply to all.

  • Users who have thanked Sputnik1 for this post:

    oesxyl (03-15-2011)

  • #7
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Sputnik1 View Post
    Hi Oesxyl

    I found this link useful.

    Go to Kempobot's response at the bottom (post #15).

    I'm still having problems getting the custom variables to work.
    thank you,

    that means this post:

    http://www.codingforums.com/showpost...4&postcount=15

    additional, NancyJ script mentioned in the previous post:

    http://www.codingforums.com/showpost...20&postcount=6

    best regards

  • #8
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Sputnik1, a couple of things. I think this:

    Code:
                <!--A outgoing link that needs to scroll down first, then right:--> 
                <a onclick="$.scrollTo( '#E7', 2000, {queue:true}, {axis:'xy'}, {easing:'swing'} );" href="#">Link6 (Needs to scroll down first, then right)</a>
    should be:

    Code:
                <!--A outgoing link that needs to scroll down first, then right:--> 
                <a onclick="$.scrollTo( '#E7', 2000, {queue:true,axis:'yx',easing:'swing'} );" href="#">Link6 (Needs to scroll down first, then right)</a>
    The yx will make it scroll down first then across, and the settings should all be combined together. The plugin takes:
    Code:
    $(...).scrollTo( target, duration, settings );
    As it stands your code is adding additional arguments to the plugin which are not recognised.
    Last edited by SB65; 03-16-2011 at 08:50 AM.


  •  

    Tags for this Thread

    Posting Permissions

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