$(function() {
block.find('.orders__info').webuiPopover({
trigger:'manual',
placement: "auto",
title: "title",
type: 'async',
content: function(data) {
return data;
},
cache: false,
animation: 'fade',
width: '300',
delay: {
show: 1,
hide: 300
}
});
block.on('click', '.orders__info', function() {
let contentId = $(this).data('ids');
$(this)
.webuiPopover('destroy')
.webuiPopover($.extend({}, {url: '/url/?elements=' + contentId} ))
.webuiPopover('show');
});
});
order = ['а', 'б', 'в'];
list = ['в', 'ю', 'а', 'б', 'г', 'д', 'а'];
list.sort((a,b) => {
if (order.indexOf(a) == -1 && order.indexOf(b) == -1) return -1;
if (order.indexOf(a) == -1) return 1;
if (order.indexOf(b) == -1) return -1;
return order.indexOf(a) - order.indexOf(b);
});
console.log(list);
<a href="http://site.ru/en/post">Test link</a>
$(function() {
$('a').each(function() {
$(this).attr( 'href', $(this).attr('href').replace('/en', '') )
})
});
Делать 50-100 запросов циклом?
UPDATE table_items
SET option = true
WHERE id in (11, 45, 81);
$('.slider').slick({
variableWidth: true,
dots: false,
infinite: false,
slidesToShow: 5,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 4
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 3
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 2
}
}
]
});