;(function($D){
var $button = $D.querySelector('.js-button'),
$container = $D.querySelector('.js-container');
$button.addEventListener('click', function(e){
var data = e.target.dataset,
toggleText = $button.innerHTML,
isVisible = $container.classList.contains('active') ? true : false
$button.innerHTML = data.toggleText;
data.toggleText = toggleText;
if(!isVisible){
$container.classList.add('active')
}else{
$container.classList.remove('active')
}
});
})(document);
$(function(){
$('.my_basket_call').on('click', '', function(){
var idclick = $(this).attr("id");
console.log(idclick);
$.ajax({
url: 'request.php',
type: 'POST',
data: 'cat='+idclick,
beforeSend: funcDown,
success: function(data){
$('.xochy_vivesti_tyt').html(data);
}
});
});
});
<?
if(isset($_POST['cat']) && !empty($_POST['cat']))
{
$res = $_POST['cat'];
echo $res;
}
?>
<div class="xochy_vivesti_tyt"></div>
$(window).on('resize', function(){
if($(window).width() <= 768) {
$('.advantages-item').unwrap();
} else{
if($('.advantages-wrap-left')[0]){
}else{
$('.fd').wrapAll('div class="advantages-wrap-left">');
}
if($('.advantages-wrap-right')[0]){
}else{
$('.fc').wrapAll('div class="advantages-wrap-right">');
}
}
}).trigger('resize');