- This topic has 15 replies, 3 voices, and was last updated 5 years, 6 months ago by
Leo.
-
AuthorPosts
-
October 19, 2020 at 5:08 am #1495359
Benny
Hey there, i wanted to know if its possible to show a floating (fixed) Call-to-Action Button after the Page-Hero. This is my website –> https://fragbenny.de/
Thank you in advance!
October 19, 2020 at 6:42 am #1495458David
StaffCustomer SupportHi there,
you can use a Block Element with the
generate_after_headerhook:https://docs.generatepress.com/article/block-element-overview/
October 19, 2020 at 8:36 am #1495752Benny
Hey David, thanks for your answer. I’ve made a new block with the hook above but it isn’t working as expected. I think i have to change it from position: fixed to sticky?
Here is the relevant CSS for the Button:width: 70px;
height: 70px;
background-color: #fbb13c;
border-radius: 50%;
text-align: center;
display: flex;
position: fixed;
right: 2%;
bottom: 3%;
transition: all 0.1s ease-in-out;At the end the button should be appear after the page-hero and it should be fixed to the bottom right.
Thanks for your help!
October 19, 2020 at 9:31 am #1495845Leo
StaffCustomer SupportIs the button added currently?
I’m not seeing anything after the page hero.
October 19, 2020 at 9:57 am #1495892Benny
It is. At the right bottom there is a fixed orange button.
October 19, 2020 at 11:21 am #1496010Leo
StaffCustomer SupportSo what is the issue currently?
I can see the button at the bottom right of the page hero and it seems work quite good?
October 19, 2020 at 11:31 am #1496017Benny
I wanted it to be over the content area and footer but not hovering over the page-hero.
October 19, 2020 at 12:26 pm #1496091Leo
StaffCustomer SupportSo basically you want it to appear after the user starts to scroll down the page?
I’m not aware of a method to do that without a custom solution unfortunately.
October 19, 2020 at 12:37 pm #1496100Benny
Yes, exactly. Maybe if the button is in the content area and with position:sticky?
October 19, 2020 at 12:50 pm #1496121Leo
StaffCustomer SupportThat case you can try the
generate_inside_container hook and see if you can make it work withposition: sticky:
https://docs.generatepress.com/article/hooks-visual-guide/October 19, 2020 at 12:52 pm #1496124Benny
I’ve tried it with z-index: -1; but then it’s half under the content area but not shown under the page-hero (which would be perfect without the other problem).
October 19, 2020 at 1:08 pm #1496152Leo
StaffCustomer SupportActually just try this CSS with your current layout:
.page-hero { position: relative; z-index: 1; }October 19, 2020 at 1:10 pm #1496155Benny
Leo, i’ve tried this already but it wasnt working. I stuck next under the page-hero and moved a bit but not as expected.
October 19, 2020 at 1:18 pm #1496172Benny
Will try!
Thanks Leo
October 20, 2020 at 12:41 am #1496537Benny
Works perfect Leo. This is what i was looking for!
-
AuthorPosts
- You must be logged in to reply to this topic.