<button class="to-top">Up</button>
.to-top {
position: fixed;
right: 30px;
bottom: 30px;
width: 40px;
height: 40px;
text-align: center;
font-size: 0;
z-index: 50;
opacity: .7;
color: #000;
background-color: orange;
transition: all 0.25s;
transform: translateX(100px);
}
.to-top::before {
content: "";
width: 14px;
height: 14px;
border: 2px solid #000;
border-left: 0;
border-bottom: 0;
ransform: rotate(-45deg);
position: absolute;
top: 16px;
left: 13px;
}
.to-top.active {
transform: translateX(0);
}
.to-top:hover {
opacity: 1;
}
$('.to-top').on('click', function() {
$('body, html').animate({ scrollTop:0 },800);
return false;
});
$(window).scroll(function() {
if($(this).scrollTop() > 100) {
$('.to-top').addClass('active');
} else {
$('.to-top').removeClass('active');
}
});
.header__inner{
position: absolute;
justify-content: flex-end;
}
<div class="items">
<?php
$count_items = 10;//кол-во выводимых элементов
$paged = get_query_var( 'paged', 1 );//Получаем текущую страницу
$id = get_category_by_slug( 'novosti' )->cat_ID;//получаем id рубрики. У меня рубрика новости.
$recent = new WP_Query( "cat=$id&posts_per_page=$count_items&paged=$paged" );//Сам запрос
while ( $recent->have_posts() ) {
$recent->the_post();
?>
<div class="item">Элемент</div>
<?php
}
wp_reset_postdata();
?>
</div>
<?php
wp_pagenavi( array( 'query' => $recent ) );//вывод пагинации по вашему запросу. Все четко:))
?>
$('select').val(chooseItem).attr('selected', 'selected');
$('select option[selected]').removeAttr('selected'); // удаление ранее установленного selected атрибута у одного из option
$('select option[value="' + chooseItem + '"]').attr('selected', 'selected'); // находим option с нужным value и устанавливаем атрибут selected
<input type="number" name="first" min="0" max="100" step="1" class="input_num" placeholder="0"/>
<input type="number" name="second" min="0" max="50" step="1" class="input_num" placeholder="0"/>
<script>
document.querySelectorAll(".input_num").forEach(function( currentInput, index, arr ) {
currentInput.onchange = function () {
if (arr[1].value > 0) {
arr[0].max = 50;
if (arr[0].value > 50) {
arr[0].value = 50;
}
} else {
arr[0].max = 100;
}
}
});
</script>
и не парься. Еще на бэке если нужно - тоже чекни ;-)<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
и все норм