-
I need to move my scroll to top to the left of the screen. I enabled it in Customizer. However, it seems I cannot control the position using my Simple CSS. It now stays on the right where I just added another icon which now covers the said button. Hence why I want to move it.
What am I overlooking?
Thanks for your support!
My site: execfrontline.com
My CSS:
.go-to-top {
cursor: pointer;
}/* If you want the icon to appear only when the user scrolls down: */
document.addEventListener(“scroll”, function () {
const scrollTopIcon = document.querySelector(“.go-to-top-container”);
if (window.scrollY > 300) {
scrollTopIcon.style.display = “block”;
} else {
scrollTopIcon.style.display = “none”;
}
});/* Up to top container: */
.generate-back-to-top,
.generate-back-to-top:visited {
bottom: 30px; /* from the bottom of your screen */
left: 30px; /* from the left of your screen */
}add_filter( ‘generate_back_to_top_scroll_speed’, ‘tu_back_to_top_scroll_speed’ );
function tu_back_to_top_scroll_speed() {
return 400; // milliseconds
} -
Hi there,
You are mixing CSS, JS, and PHP in your code, so please remove all of them.
And here’s the correct CSS to change its position:
a.generate-back-to-top { left: 30px; }
-
Yep, thanks and resolved! Not sure where I got the code from. I hope not ChatGPT :).
NP
-
You are welcome 🙂
- You must be logged in to reply to this topic.