@media (hover: hover) {
.swatch__list--item:hover .swatch__tooltip {
top: -33px;
opacity: 1;
visibility: visible;
}
}
<?php
$kakoyto_php_kod = '100%';
echo "Hello world, Im php" ;
?>
<script type="text/javascript">
$(document).mouseup(function () {
$('.header__burger').click(function (e) {
e.preventDefault()
$('.header__nav').toggleClass('header__nav--active')
})
})
$(document).mouseup(function (e) {
var $target = $(e.target)
if ($target.closest('.header__menu').length == 0) {
$('.header__nav').removeClass('header__nav--active')
}
})
</script>
<?php
$ostalnoy_php_kod;
?>
const { hash, href } = window.location;
const urlc = href.replace(hash, '');
if (hash && decodeURIComponent(readCookie('commentadd')) === urlc) {
alert("Комментарий оставлен");
}
const { hash, href } = window.location;
if (hash && href.includes(decodeURIComponent(readCookie('commentadd')))) {
alert("Комментарий оставлен");
}
fieldSearch == ''
fieldSearch.length < 1
$('.header__field-search').on('input', function () {
const fieldValue = $(this).val();
if(!fieldValue.val().length){
console.log('0')
return;
}
if(fieldValue.length) {
console.log('больше 1')
return;
}
})
$('#tags').val($(this).text());
$('#tags').val($('#tags').val() + $(this).text());
const items = Array.from(document.querySelectorAll('.cost__elem'));
for (let i = 0; i < items.length; i++) {
if (!items[i].className.includes('cost__elem--current')) {
items[i].classList.add('cost__elem--success');
} else {
return;
}
}
document.addEventListener('DOMContentLoaded', () => {
const policy = document.getElementById('policy');
const policyReplaced = 'policy_confirm'.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,'\\$1');
const regExp = new RegExp(`(?:^|;)${policyReplaced}=([^;]*)`);
const cookie = document.cookie.match(regExp);
if (cookie[1] === 'Y') {
policy.remove()
return;
}
const policy_box = document.querySelector('div.policy-container');
if (policy_box) {
return;
}
const confirmButton = '<a href="javascript:void(0)" class="policy-confirm"><?php echo $text_btn_privacy; ?></a>';
policy_box.innerHTML = `
<div class="policy-text">
<?php echo ${!navigator.cookieEnabled ? '$text_privacy_enabled;' : '$text_privacy;'} ?>
</div>
<a href="javascript:void(0)" class="policy-confirm"><?php echo $text_btn_privacy; ?></a>
${navigator.cookieEnabled && confirmButton || ''}
`;
setTimeout(() => {
policy.appendChild(policy_box);
policy.classList.add('active');
setTimeout(() => policy.classList.add('activated'), 400);
const policy_confirm = document.querySelector('.policy-confirm');
policy_confirm && policy_confirm.addEventListener('click', () => {
policy.classList.remove('activated');
setTimeout(() => policy.remove(), 300);
document.cookie='policy_confirm=Y; path=/'
})
},100)
})
var left = Math.round(newLeft / stepSize) * stepSize;
console.log('left ' + left);
thumb.style.left = left + 'px';
thumbVal.innerHTML = (left / stepSize) * step;
var left = Math.round(newLeft / stepSize) * stepSize;
console.log('left ' + left);
thumb.style.left = left + 'px';
thumbVal.innerHTML = Math.round(left / stepSize) * step;
value = value.replace(/\D/, 0);
<button class="btn_access func-during" onclick="() => applyFilters()">Подобрать</button>
<button class="btn_access func-during" onclick="function(){ applyFilters() }">Подобрать</button>
<button class="btn_access func-during" onclick="applyFilters">Подобрать</button>
const values = [25, 0, 23, 52, 0, 32];
// Константа, дефолтное значение, показывающее максимальную высоту твоих столбиков, в пикселах
const maxHeight = 300;
const getPixelsFromPercents = (val) => (maxHeight * val / 100) + 'px';
// В цикле где-нибудь запустить и убрать первый индекс
const styles = {
height: getPixelsFromPercents(values[0]),
}
// Осталось куда-нить прикрутить что получилось
const values = [25, 0, 23, 52, 0, 32]; // Массив процентов для графика
const maxHeight = 300; // Максимальная высота столбца
const getPixelsFromPercents = (val) => (maxHeight * val / 100) + 'px'; // Функция считающая проценты в пикселах
const labels = Array.from(document.querySelectorAll('.recharts-text.recharts-label')); // Массив столбиков
labels
.map((item, index) = > {
// Каждому столбику присваеваем высоту согласно массиву процентов
item.style.height = getPixelsFromPercents(values[index]);
})
const [...{name:name}] = data;
const [{name: name}] = data;
const data=[
{id:1, name:"ganna",age:15},
{id:2, name:"anna",age:16},
{id:3, name:"petro",age:54}
];
const arr = Object.values(data).map(item => [{ name: item.name }]); // Массив массивов с объектами
const arr2 = Object.keys(data).map(() => []); // Массив пустых массивов, чтоб можно было пушнуть элементы в
// массив. Еще можно так Array.from(data).fill([]);
Object.values(data).map((item, index) => arr2[index].push({ name: item.name }));
console.log(arr);
//=> [
// [{name: 'ganna'}],
// [{name: 'anna'}],
// [{name: 'petro'}]
//. ]
console.log(arr2);
//=> [
// {name: 'ganna'},
// {name: 'anna'},
// {name: 'petro'}
//. ]
#aside-fixed {
width: 150px;
position: relative;
height: 100%;
@media screen and (max-width: 1024px) {
display: none;
height: 0;
}
}
#aside-fixed {
width: 150px;
position: relative;
height: 100%;
}
@media screen and (max-width: 1024px) {
#aside-fixed {
display: none;
height: 0;
}
}