Jump to content

Floating button anchor

Recommended Posts

Posted

Site URL: https://eduall.squarespace.com/pravidla

Good morning, 

i created a floating button "Order a webinar", here: https://eduall.squarespace.com/pravidla

But i need to make an anchor and redirect the button to that anchor (at the bottom of the page), so i need make a jump page on the same page. 

 

I probably know how to create an anchor with ID, but i dont know how the code in the floating button redirect to the anchor. 

 

I use this code for the floating button:

<a href="eduall.squarespace.com" class="t-button">Objednat webinář</a>
<style>
  .t-button {
      display: inline-block;
    background: green;
    color: white;
    padding: 1em 2em;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    position: fixed;
    top: 50%;
    right: 0;
  }
</style>

 

and this code for the anchor:

<p id="nameofanchor"></p>

 

Thank you for your help, im trying to make it work last two days 😄

Michal

 

 

 

  • Replies 5
  • Views 512
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted

The href is wrong, it's needs to be like this:

href="/page-slug/#anchor-id"

Do not include the Squarespace URL just the but after the .com 

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Posted
4 minutes ago, Ziggy said:

The href is wrong, it's needs to be like this:

href="/page-slug/#anchor-id"

Do not include the Squarespace URL just the but after the .com 

 

Thanks, i"ll try. The anchor id code its all right? 

Posted

Anchor code is fine, you've correctly not added any spaces, though you could use <span> instead of <p> if you're not putting any text. 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Posted

Hello

i managed it to make it work, thanks for your help!

But i have one more question. 

Now its "jump" directly to the order button, but i would prefer to scroll through the whole landing page to order button. 

 

Michal

 

 

 

 

 

 

 

Posted
html {
  scroll-behavior: smooth;
}

Add this to your Custom CSS. 

 

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.