Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1407165

    Richard H
    Participant

    I am looking to add a “page contents” section at the beginning of a couple of my longer pages that have a fair bit of info on them. I am planning on using this type of code in the contents list:
    Your Link Text
    and the target that I want it to jump to:
    Target Text

    Would that work in itself?

    If so I would like the transition from clicking the content element to the place on the page where it is to be a smooth swift scroll to the content. I would rather do this without adding plugins and I found this site that gives info on how that might be possible …
    https://css-tricks.com/snippets/jquery/smooth-scrolling/

    Would this kind of thing be possible in X? If so I would appreciate it if you could let me know what code is needed where so I can make that happen. Thanks for all your wonderful support 😉

    #1407199

    Richard H
    Participant

    oops….seems the code got changed.

    The page contents section at the top of the site will be something like:
    https://www.example.com/#example

    and the target will have a code like this:

    <a name="example"></a></p>

    I have started to set this up on my site but I still need the smooth scroll effect if possible. I have also noticed that the jump takes the page down so that the heading linked to is at the very top of the page but unfortunately my header is covering the H2 heading so it is invisible unless you scroll up a bit. Is there a way to offset the jump so the H2 headline is visible or so the site header is not counted as part of the page?

    #1407202

    Richard H
    Participant
    This reply has been marked as private.
    #1407614

    Christopher
    Moderator

    Hi there,

    You don’t need to follow that article.
    Add following HTML in text or raw content element.

    <a href="#contact">contact us</a>|<a href="#x-section-1">section 1</a>

    Hope it helps.

    #1407760

    Richard H
    Participant

    I’m sorry but I am not that advanced with this kind of stuff so I don’t understand what the code means. Could you break it down a bit for me please?
    Also, it seems that you are addressing the page jump issue I asked about but have ignored the smooth scrolling part which is the main focus of what I am asking about. Telling me that I don’t need that article doesn’t really help me understand how to find the solution to my query.
    Is the smooth scrolling feature already in X which is why I don’t need that article?
    Some extra detail would really help. Thanks

    #1407765

    Richard H
    Participant

    And you have ignored my question about the fact that when the page does jump it places the header that is the focus of the jump underneath the site header so the H2 title is obscured. Is there a way to offset the jump or to make the header of the site be taken into account?

    #1408179

    Christian
    Moderator

    Hey Richard,

    Smooth scroll is included in Cornerstone out of the box. You just need to set the href of your link to the ID of your text.

    Thanks.

    #1409605

    Richard H
    Participant

    Thanks for clearing that up. All sorted now

    #1409742

    Rahul
    Moderator

    Glad to hear it!

    Feel free to ask us if you have any further queries regarding the X-theme.

    Thank you. 🙂