// Дополнительный массив
var columnsHeight = Array.from({
length: columnsCount
}, function () {
return [];
});
React.Children.forEach(children, function (child, index) {
if (child && React.isValidElement(child)) {
const { sizeHeight } = child.props.document;
columnsHeight[index % columnsCount] = +columnsHeight[index % columnsCount] + sizeHeight
var minIndex = columnsHeight.indexOf(Math.min.apply(null, columnsHeight));
if (columns[minIndex]) {
columns[minIndex].push(child)
}
//columns[index % columnsCount].push(child);
}
});
if (player_chance > enemy_chance) {
else if (enemy_chance > player_chance)
player_hp -= **
enemy_hp -= (p <= 10 && p > 7) && 40 || (p <= 7 && p > 5) && 20 || (p <= 5 && p > 0) && 10
player_hp -= (e <= 10 && e > 7) && 40 || (e <= 7 && e > 5) && 20 || (e <= 5 && e > 0) && 10
enemy_hp = hp(player_chance)
player_hp = hp(enemy_chance)
function hp(e) {
return (e <= 10 && e > 7) && 40 || (e <= 7 && e > 5) && 20 || (e <= 5 && e > 0) && 10
}
function send_message(conv,message){
if (conv.length > 4) {
conv = conv + "<br>";
}
$("#converse").html(conv +"<div class='message-box left-img' style='display:none'><div class='picture'><img src='/my2/a.png' title='user name'></div><div class='mes'><span class = 'current-msg'>" + "<span id='chat-bot'>Бот: </span><p>" + message + "</p></span></div></div>");
$(".current-msg").delay(500).fadeIn('show', function() {
// Анимация завершилась и можно делать все что душе угодно
$(".current-msg").removeClass("current-msg");
var e = document.getElementById('converse');
e.scrollTop=e.scrollHeight
})
}
.col-lg-4 {
position: relative
}
.col-hide {
position: absolute;
background: #ddd;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: .3;
z-index: 2
}
<div class="row">
<?php foreach($actionArr as $action){ ?>
<div class="col-lg-4 col-md-6 mb-4">
<?php if ($action['rezerved']) { ?>
<div class="col-hide"></div>
<?php } ?>
var e = document.querySelectorAll('tr');
Array.prototype.forEach.call(e, function(e) {
e.addEventListener('click', n)
});
function n(e) {
var id = e.target.getAttribute('data-id');
$.getJSON...............
for..........
if(id == data[i].id)
// че то делаем
}