Здравствуйте.
На форуме стоит "стрелка вверх". Все хорошо, но мешается на мобилках. Подскажите пожалуйста, что нужно добавить в JS код, что бы стрелка была скрыта при ширине экрана x?
jQuery(document).ready(function() {
jQuery('body').append('<div class="button-up" style="display: none;opacity: 0.7;width: 40px;height:100%;position: fixed;left: 0px;top: 0px;cursor: pointer;text-align: center;line-height: 30px;font-size:20px;color: #d3dbe4;font-weight: bold;">↑</div>');
jQuery (window).scroll (function () {
if (jQuery (this).scrollTop () > 100) {
jQuery ('.button-up').fadeIn();
} else {
jQuery ('.button-up').fadeOut();
}
});
jQuery('.button-up').click(function(){
jQuery('body,html').animate({
scrollTop: 0
}, 0);
return false;
});
jQuery('.button-up').hover(function() {
jQuery(this).animate({
'opacity':'1',
}).css({'background-color':'#fff','color':'rgb(136, 136, 136)'});
}, function(){
jQuery(this).animate({
'opacity':'0.7'
}).css({'background':'none','color':'#d3dbe4'});;
});
});