0
Welcome Guest! Login
0 items Join Now

Smooth Scrolling - Creating your first atom (Revised)

    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • Totop script and function is part of core gantry5 - so I won't be changing that. So, you can't change the easing on totop or add the #.

      What I would suggest instead is that you just create your own customhtml particle instead of using the totop particle in that just put...
      <a href="#" alt="To Top">To Top</a>

      Then my smooth scrolling script will apply instead and you've be able to do everything you wanted.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Arnaud's Avatar
    • Arnaud
    • Sr. Rocketeer
    • Posts: 232
    • Thanks: 3

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • OK, I can try this to get the same easing everywhere.
      Thank you for this relevant suggestion.

      But about the # in the URL, I meant exactly the opposite : remove it from the URL.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • look at my script line 18 - just remove the "else".

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Arnaud's Avatar
    • Arnaud
    • Sr. Rocketeer
    • Posts: 232
    • Thanks: 3

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • I've removed
      "else {window.location.hash = "#";}"
      and even only "else"

      But it doesn't seem to work.

      Well, I didn't want to bother you that much with that, it's just that since we're in the process of manipulating those #, I thought there might be a solution…
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • well I just tried it and it worked perfectly:

      removing:
      else {window.location.hash = "#";}

      Did you click on the home page button first so you have a link without the "#" as the starting point?

      In fact - i've just updated my code above and removed that as it is not necessary. - it works fine?

      Regards, Mark.
    • Last Edit: 8 years 9 months ago by MrT.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Arnaud's Avatar
    • Arnaud
    • Sr. Rocketeer
    • Posts: 232
    • Thanks: 3

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • Yes, even starting without # in the URL by clicking the home menu, even locally or on a server, on 3 different browsers, I still get the #anchor in the URL (I'm still talking about links that are NOT the Totop link).
      This is really weird because it's like removing this part of your code has no particular visible consequence :-O
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • The change that I suggested was to stop the www.yourdomain.com/# ( i.e. just a hash). It will not prevent www.yourdomain.com/#youranchor That is how it should work so people can bookmark the correct page and position within the page.

      In your case the issue is because you are using the Gantry Structural ID's as the anchors in your links - you shouldn't use these. Instead you should put your own anchors in the content and use those instead - then the anchors names would be something meaningful to your site.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Arnaud's Avatar
    • Arnaud
    • Sr. Rocketeer
    • Posts: 232
    • Thanks: 3

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • OK, I get you loud and clear : I can't and even shouldn't do what I had in mind.
      Those Gantry anchors were only for tests, but you're right, meaningful anchors should be more useful :-)

      I've just been following your advice and created a Custom HTML particle with this "#" link you suggested.
      Here again : unexpected behaviour.
      I mean the page just… reloads ! Instead of scrolling.
      Any idea about what I missed ?
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • I'm having my headstone remade now "RIP MrT - he really tried to help Arnaud" - LOL :)

      Ok you found a bug in Gantry 5 - congratulations - I have raised a ticket here https://github.com/gantry/gantry5/issues/624

      I added the customhtml module to your outline and found the same as you - the link is being changed from "#" to "/" which is not correct - I spoke to our DEVS and they asked me to raise a ticket.

      Regards, Mark.
    • The following users have thanked you: Arnaud

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Arnaud's Avatar
    • Arnaud
    • Sr. Rocketeer
    • Posts: 232
    • Thanks: 3

    Re: Smooth Scrolling - Creating your first atom (Revised)

    Posted 8 years 9 months ago
    • Haha, well I guess it might be cautious to wait for a few more years before engraving your headstone. I mean who knows, you may still have to deal with worse than me, sooner or later :-)

      I'm almost flattered that "I" found a bug in Gantry 5, but I think we can share the credits here !

      OK, I've been looking at the generated code and I see what you mean.

      So let's go back to the original ToTop Particle… As we say in french "All this for this…" :-)

      I hope I can get notifyed when this issue is fixed.

      Many thanx again for your patience, you've been really helpful :-)
      Rest in peace… at least for one night !

Time to create page: 0.060 seconds