Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. Link to a section with scroll to top button effect

Link to a section with scroll to top button effect

Scheduled Pinned Locked Moved Bug Reports
6 Posts 2 Posters 721 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • NicolasN Offline
    NicolasN Offline
    Nicolas
    wrote on last edited by
    #1

    Hi, is it possible to make a link to a section with an id and the effect like the "scroll to top" button?

    Thanks!
    Nicolas

    1 Reply Last reply
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Hi @Nicolas

      does this answer your question?
      http://laythemeforum.com:4567/topic/2863/link-to-anchor-from-another-page/4

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • NicolasN Offline
        NicolasN Offline
        Nicolas
        wrote on last edited by Nicolas
        #3

        Hi @mariusjopen

        I think it's the idea, but i want to do that in the same page :

        1- i put an image and i make an id (like hello)
        2-i have a text link in this page (at the top for exemple) and in the link url i write this : http://mysite/#hello
        3-when i click on this text link i want to go to the image with smooth scroll effet :)

        It is possible? Here is my website with the menu with links which refers to the images (but not with smooth effect): http://druidhigh-visuals.com

        Thanks!

        1 Reply Last reply
        0
        • mariusjopenM Offline
          mariusjopenM Offline
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          Dear @Nicolas

          have a look here:
          http://jsfiddle.net/kevinPHPkevin/8tLdq/1/

          And consider this:
          http://laytheme.com/documentation.html#custom-javascript

          It won't be that difficult :-)

          Best!

          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • NicolasN Offline
            NicolasN Offline
            Nicolas
            wrote on last edited by
            #5

            Hi @mariusjopen

            It's works! :D Thank you very much.
            Here's how I did it with the help of your links:

            window.laytheme.on("newpageshown", function(layoutObj, type, obj){
                jQuery("#button").click(function() {
                jQuery('html, body').animate({
                    scrollTop: jQuery("#myid").offset().top
                }, 2000);
            });
            });
            

            for now this code works on a single id and link. I will try to adapt it to do this on several different links and ids.

            1 Reply Last reply
            0
            • mariusjopenM Offline
              mariusjopenM Offline
              mariusjopen
              Global Moderator
              wrote on last edited by
              #6

              Dear @Nicolas

              great! Super cool!

              Thank you for sharing!

              Best!

              Marius

              www.mariusjopen.world

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              I also code custom websites or custom Lay features.
              šŸ’æ Email me here: šŸ’æ
              info@laytheme.com

              Before you post:
              1. When using a WordPress Cache plugin, disable it or clear your cache.
              2. Update Lay Theme and all Lay Theme Addons
              3. Disable all Plugins
              4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

              This often solves issues you might run into

              When you post:
              1. Post a link to where the problem is
              2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
              3. If the problem is difficult to explain, post screenshots / link to a video to explain it
              Online Users
              reinterpretR
              reinterpret
              arminunruhA
              arminunruh
              J
              joackim
              Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
              laytheme.com
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search