Jump to content

Jump-to-Top Button?


Recommended Posts

tomnjerry74
Posted

On one of my sites, I use one of those buttons that appear after you scroll down a certain amount that allows you to jump to the top of the page:

<div class="scrolltop" style="display:none;"><a href="#top" class="d-flex"><i class="fas fa-chevron-up"></i></a></div>
<script type="text/javascript">
$(document).scroll(function() {
	var y = $(this).scrollTop();
	if (y > 800) {
		$('.scrolltop').fadeIn();
	} else {
		$('.scrolltop').fadeOut();
	}
});	
</script>

As you can see, there's a div and some javascript that needs to be implemented in order for it to function. My question is, is there an Emby footer or header file where this code can be implemented so that it attaches to all pages? Where would be the best place to insert this?

tomnjerry74
Posted (edited)

Well, I've figured out how/where to add this code, but unfortunately it isn't compatible with Emby's scrolling system. If anyone knows a way to successfully add a scroll-to-top button I would very much appreciate it.

Edited by tomnjerry74
Posted

Yea you'll probably have a hard time due to the custom scrolling needed for virtual scrolling.

tomnjerry74
Posted

Thanks for the response.

I've gone ahead and just made this a feature request, as I think that's more appropriate.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...