var i = 15;
var acc = 0;
var timerId = setTimeout(function go() {
console.log(acc);
if (i > 0)
{
acc++;
if(acc > 3 ){ acc = 0; }
//console.log(acc);
setTimeout(go, 100);
};
i--;
}, 100);
$('#content .boxcontainer').on('click', 'article button.emb', function(){
$('#content .boxcontainer').children('article').removeClass('active');
$('#content .boxcontainer').children('article').addClass('non_active');
embButtonClick( $(this) );
$(this).parents('article').removeClass('non_active');
$(this).parents('article').addClass('active');
});
function embButtonClick(thisss) {
var block = thisss.next('.meta-data'),
pinbox = thisss.parents('.pinbox');
pinbox.toggleClass('pinbox_active');
if (pinbox.hasClass('pinbox_active')) {
block.slideDown(100);
$(document).on('click', function(event) {
if ($(event.target).closest(pinbox).length) {
if (!$('.modal-backdrop').length)
$('body').append('<div class="modal-backdrop fade in"></div>');
$('.modal-backdrop').bind('click', ModalBackdropClear);
return;
}
block.hide(100);
pinbox.removeClass('pinbox_active');
$('.modal-backdrop').remove();
event.stopPropagation();
});
}
}
function ModalBackdropClear(){
$('#content .boxcontainer').children('article').removeClass('active non_active');
}
var tempScrollTop = 10, currentScrollTop = 0;
var top1;
jQuery('.popup-post.active').scroll(function(){
currentScrollTop = jQuery(this).scrollTop();
if (tempScrollTop < currentScrollTop ){ //Скролим вниз
jQuery('.vverh').сss('display', 'block');
jQuery('.vniz').сss('display', 'none');
tempScrollTop = currentScrollTop;
top1 = currentScrollTop;
} else if (tempScrollTop > currentScrollTop ) { //Скролим вверх
jQuery('.vverh').сss('display', 'none');
jQuery('.vniz').сss('display', 'block');
tempScrollTop = currentScrollTop;
}
});
jQuery('.vniz').click(function(){
jQuery('popup-post.active').animate({ scrollTop: top1 }, '50');
});
jQuery('.vverh').click(function(){
jQuery('popup-post.active').animate({ scrollTop: jQuery('body').offset().top }, '50');
});
<input name="name" type="text" class="required" aria-required="true" placeholder="Ваше имя">
$('#kont-res-or-run').on('submit', function(e) {
if (!$(this).valid()) return false;
if ($("#kont-res-or-run").length){
$("#kont-res-or-run").validate({
rules:{
telef:{
required: true,
digits: true,
minlength: 10,
maxlength: 15,
},
message:{
required: true,
minlength: 8,
maxlength: 300,
},
}
});
}
$(window).scroll(function(){
console.log($(this).scrollTop());
var attrstyle = 'height:' + $(this).scrollTop()/2 + 'px;';
$("#Vash-id").attr('style', attrstyle);
});
add_action('wp_ajax_nopriv_ajaxmass', 'true_get_ajax_mas');
$agro_id = implode(", ", json_decode($_REQUEST["checks"]));
$.ajax({
url : 'http://' + location.host + '/wp-admin/admin-ajax.php',
data: { action: 'ajaxmass', checks: localStorage.myArray
},
success: function (menu) {
$('.content2 .testim').eq(0).html(menu);
$('.izbran').unbind().bind('click', clickOnStar);
console.log(menu);
}
});
$(".container").each(function(index, item){
var currentDivValue = $(item).children("span").text();
var ifFound = false;
storedArray = JSON.parse(localStorage.myArray);
storedArray.every(function(item, index){
console.log(item); if(item == currentDivValue){ifFound = true;return false;}
return true;
});
if(ifFound){$(item).children(".izbran").addClass("ura");}
});