Answer the question
In order to leave comments, you need to log in
Disable script at certain screen resolution?
I messed up the up arrow on the site, you need to make sure that when the media value (max-width: 320px) is set, the script is disabled
<script type="text/javascript">
$(function() {
$(window).scroll(function() {
if($(this).scrollTop() != 0) {
$('#toTop').fadeIn();
} else {
$('#toTop').fadeOut();
}
});
$('#toTop').click(function() {
$('body,html').animate({scrollTop:0},800);
});
});
</script>
Answer the question
In order to leave comments, you need to log in
if(window.innerWidth > 320){
$(window).scroll(function() {
if($(this).scrollTop() != 0) {
$('#toTop').fadeIn();
} else {
$('#toTop').fadeOut();
}
});
$('#toTop').click(function() {
$('body,html').animate({scrollTop:0},800);
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question