Site logo

Archived topic

Down arrow in top full width/height container

3 replies · Started by Michael on September 15, 2021

Viewing posts 1–4 of 4

Hello

I am currently trying to find a nice solution while implementing an arrow within my section (please check the private section to see the URL).
Saw 1-2 previous but quite old threads here with a similiar topic, however, I am not quite happy with the current solution done within the container and an arrow down button with padding top of 350px.

Is there a better solution to implement this which makes it float at the bottom of the top fullscreen section no matter what screen size we have?
I tried to have the arrow as a background image but this was always hidden behind the current fullscreen background image (even if I changed the z-index value).

Thanks a lot
Michael

Hi Ying

Sorry for my late reply, I had to wait for the customer to response as well.

I think the button/arrow down is positioned nice now. In addition, I would like to hide it on scroll using JavaScript.
By using the following code I thought it should work, but unfortunately it does not:

// Function to let the arrow down disappear after scroll
add_action('wp_footer', 'disappear_on_scroll_script', 9999);
function disappear_on_scroll_script() {
    ?>
<script>
$(document).ready(function(){
    $(".scroll-down-disappear").click(function(){
        $("a").addClass("scroll-down-disappear");
		$("#arrow-down-icon").hide();
    });
	$(window).onscroll(function() {
    if ($(this).scrollTop() > 0) {
        $("#arrow-down-icon").hide(); // Hide the element
    }
	});
})(jQuery);
</script>
    <?php
}

Any idea what I am doing wrong here?

Thanks a lot

This archived topic is closed to new replies.