$('.priceSort-table__item td:nth-child(2)').each(function(){
var item = $(this),
parent = item.closest('tr'),
text = item.text(),
regex = /(\d+)(?:х|x)?/g,
match = text.match(regex),
arr = [];
while ((m = regex.exec(text)) !== null) {
arr.push(m[1]);
}
item.text(arr.join(" "));
arr.forEach(function(dig, idx){
switch(idx){
case 0:
parent.addClass('l' + dig);
break;
case 1:
parent.addClass('w' + dig);
break;
case 2:
parent.addClass('h' + dig);
break;
}
});
});
<td class="td" rowspan="4" width="20%">
<div class="bg"style="filter: blur(px);background-image: url('https://image.gametracker.com/images/maps/160x120/cs/de_dust2_2x2.jpg');box-shadow: inset 0px 0px 10px 0px rgba(50, 50, 50, 0.75);"></div>
<div class="addon-installed" style="-webkit-box-shadow: 3px 2px 5px 0px rgba(31, 31, 31, 0.6);-moz-box-shadow: 3px 2px 5px 0px rgba(31, 31, 31, 0.6);box-shadow: 3px 2px 5px 0px rgba(31, 31, 31, 0.6);padding-right: 5px;width: max-content;margin-right: -2px;margin-top: -63px;text-align: center;">Сервер выключен =(</div>
</td>
.td {
position: relative;
}
.bg {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left:0px;
right: 0px;
bottom: 0px;
z-index: 0;
}
.addon-installed {
z-index: 1;
position: relative;
}
AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType x-font/woff .woff
AddType font/woff2 .woff2
(function($){
var windowSize = 1140,
isDesktop = !($(window).width() < windowSize),
$categoriesWrap = $('.categories-wrapper'),
$headerMain = $('header'), // Скорее всего что-то типа так
headerMainHeight = $headerMain.height(),
scrollTop = $(window).scrollTop(),
forDesktop = function(){
!$categoriesWrap.is(":visible") && $categoriesWrap.css({'display': 'block'});
scrollTop = $(window).scrollTop();
if(scrollTop < headerMainHeight + 10){
$categoriesWrap.removeClass('fixed');
$categoriesWrap.css('display', 'block');
$categoriesWrap.css('opacity', 1);
}
if(scrollTop > headerMainHeight + 10) {
$categoriesWrap.css('opacity', 0);
$categoriesWrap.css('display', 'block');
}
if(scrollTop > headerMainHeight + 100) {
$categoriesWrap.addClass('fixed');
$categoriesWrap.css('opacity', 1);
}
},
forMobile = function(){
$('body').css('padding-top', 100);
$categoriesWrap.is(":visible") && $categoriesWrap.css({'display': 'none'});
scrollTop = $(window).scrollTop();
if(scrollTop > headerMainHeight + 10) {
$categoriesWrap.hide();
}else if(scrollTop < headerMainHeight + 10){
headerMain.removeClass('fixed');
$categoriesWrap.hide();
}
if(scrollTop > headerMainHeight + 100) {
headerMain.addClass('fixed');
}
};
// Подписываемся на события
$(window).on('resize scroll', function(e){
isDesktop = !($(window).width() < windowSize);
headerMainHeight = $headerMain.height();
isDesktop ? forDesktop() : forMobile();
});
// Запустим
isDesktop ? forDesktop() : forMobile();
}(jQuery));
<!DOCTUPE HTML>
<html>
<head>
<title>Test</title>
</head>
<body>
<input type="file"><br>
<input type="file"><br>
<input type="file"><br>
<input type="file"><br>
<input type="file"><br>
<input type="file"><br>
<input type="file"><br>
<button id="click">Test</button>
<script>
var btn =document.getElementById('click');
click.addEventListener('click', function(e){
var files = document.querySelectorAll('input[type="file"]'),
fd = new FormData();
if(files){
files.forEach(function(input, index, list){
if(input.files.length){
fd.append("filesUpload[]",input.files[0]);
}
});
}
// вывод для теста
console.log(fd.getAll('filesUpload[]'));
// Отправляем ajax
// Повесить обработчики отправки!!!!
var request = new XMLHttpRequest();
request.open("POST", "http://localhost/submitform.php");
request.send(fd);
});
</script>
</body>
</html>