Here are a few more tricks that can be useful not only when creating a floating button for a website:
If you add the property -webkit-transition: 0.33s allease-out; -o-transition: 0.33s allease-out; transition: 0.33s allease-out; to the fixedbut class, the element (including the button) to which the :hover pseudo-class is assigned will smoothly change color.
If you add the property pointer-events: none;, this will prevent the script from triggering or clicking on the link. Thus, if a click is made on the link <aclass="fixedbut" style="pointer-events: none;" href="/o-nas/">Bonus!</a>, nothing will happen, that is, there will be no transition to the specified link.
If you want the page to open in a new high school coaches email list tab when you click on a link, you should add the target="_blank" attribute.
In order for the button, or rather the image on it, to change, the image file must have two parts, one - a regular arrow, the other - an active one (it becomes this way when you hover over it with the cursor). The user sees one half. It can be done in such a way that the first arrow is translucent, and the second - bright opaque.
In this case, the numbers correspond to an 88x250 px image, and the arrows are 125 px high. If you need an image with other dimensions, you will need to change the width and height values in the code to those that are suitable for your project.
The image offset, that is, the background-position value, should be made such that it is slightly larger than half the height of the image.
The indent from the bottom edge of the screen is defined by the value bottom, from the left – left. It can be set in percent, as in this case, and in pixels, as in the HTML example (right was set in px).
By removing the following line from the code, it can be simplified a bit:
+ '.scrollTop:hover{ background-position:0 -133px;}'
How to achieve multiple growth in traffic and sales from your website?
Alexey Boyarkin
Dmitry Svistunov
Head of SEO and Development
Read more posts on my personal blog:
I have always been concerned about the issue of moving to a fundamentally new level. So that the indicators would grow not by 2 or 3 times, but by several orders of magnitude. From a thousand visits to ten thousand or from ten thousand to a hundred thousand, if we are talking about a website, for example.
And I know that such leaps are always the result of painstaking work in five areas:
Technical condition of the site.
SEO.
Collection of site semantics.
Creating useful content.
Working on conversion.
And at the same time, every manager needs an increase in sales and the number of applications from the site at the moment.
To get this growth, download our step-by-step template for increasing sales from the site:
Download template
Already downloaded
153442
Thanks to it, the image on the button can change when you hover over it with the cursor; without it, it will always be the same. Now you won't need a picture with a double image, you can put any arrow.
Image for a floating button on a website
-
- Posts: 274
- Joined: Mon Dec 23, 2024 3:42 am