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