JSFiddle - React, Tailwind, and code Playground
by kirito0709
HTML
другой путь
JavaScript
var c, pc, nc, ni, niw, nih, shit_o, shit, p, product;
c = $('.adaptive_section_item_list');
pc = '<div class="pseudo_catalog"></div>';
c.parent().append(pc);
cc = c.clone();
c.css({"visibility":"hidden"});
c.parent().find('.pseudo_catalog').css({"position":"absolute","left":"15px","right":"15px","top":"0"}).append(cc);
//c.parent().find('.pseudo_catalog').append('<style>.{}</style>');
nc = c.parent().find('.pseudo_catalog .adaptive_section_item_list');
ni = $(nc).find('.item_wrap');
niw = $('.item_wrap').width();//ширина элемента
nih = $('.item_wrap').height();//высота элемента
//console.log('moveL = '+moveL);
nc.prepend('<div id="shit" class="shit pa" style="color:#7b2727;font-size:40px;left:'+0+'px;top:'+0+'px;"><div class="shit_arms"><span id="leftArm" class="leftArm pa" style="transform: rotate(45deg);font-size: 20px;top: 15px;left: 0px;font-weight: 900;">/</span><div class="shit_legs"><i class="fas fa-poo"></i></div><span id="rightArm" class="rightArm pa" style="transform: rotate(-45deg);font-size: 20px;top: 15px;right: -1px;font-weight: 900;">\\</span></div></div>');
shit_o = c.parent().find('.shit');
shit = shit_o[0];
//console.log(ni);
function getCoords(elem) {
let box = elem.getBoundingClientRect();
return {
top: box.top + pageYOffset,
left: box.left + pageXOffset
};
}
var products = [];
var defaultBtnPosition;
function Product(item) {
this.item = item;
//his.width = $(this.item).width();
//this.height = $(this.item).height();
this.pos = this.item.getBoundingClientRect();
this.width = this.pos.width;
this.height = this.pos.height;
this.number;
this.line;
this.pl = 15;
this.pr = 15;
this.btn = $(this.item).find('.action_btn');
this.btn.pos = this.btn[0].getBoundingClientRect();
this.btn.height = this.btn.pos.height;
this.btn.width = this.btn.pos.width;
this.btn.mr = 10;
this.btn.mb = 15+1;
this.btn.fromTop;
}
for(var i=0; i<ni.length; i++){
//console.log(ni[i])
products[i] = new Product(ni[i]);
products[i].number =...