const getFirstDateofMonth = date => new Date(date.getFullYear(), date.getMonth(), 1).getDay();
const getDaysInMonth = date => new Date(date.getFullYear(), date.getMonth()+1, 0).getDate();
const createMonth = (date, el) => {
const startFrom = getFirstDateofMonth(date); // Return the number of the first day
const daysAmount = getDaysInMonth(date); // Return the number of days in the month
for (let i = 1; i < startFrom+daysAmount; i++) {
const li = document.createElement('li');
// Colorize cells
if (i < startFrom) {
li.classList.add('past');
} else {
li.classList.add('current')
}
el.appendChild(li);
}
}
const calendar = document.getElementById('calendar'); // Container
const date = new Date(Date.now()); // Date
/*
date - some date in format:
- new Date('November 17, 1995 03:24:00')
- new Date(Date.now())
- new Date('1995-12-17T03:24:00')
- ....
calendar - DOM element
*/
createMonth(date, calendar);
<div class="js-courses-type" data-loop="4"></div>
<div class="js-courses-type" data-loop="2"></div>
<div class="js-courses-type" data-loop="1"></div>
<div class="js-courses-type" data-loop="3"></div>
<div class="js-courses-type" data-loop="5"></div>
const courses = [...document.querySelectorAll('.js-courses-type')].sort((a, b) => a.getAttribute('data-loop') - b.getAttribute('data-loop'));
courses.forEach( course => window.console.log(course));
<path class="path-2" d="M0,400 L 1000,400 1000,445 S 500,420 0,480 Z" fill="#2b81bf"></path>
<path class="path-2" d="M0,400 L 1000,400 1000,500 S 500,500 0,500 Z" fill="#2b81bf"></path>
let i = 0;
(function loop() {
i++;
path.setAttribute('d', `M0,400 L 1000,400 1000,445 S ${i},420 0,480 Z`);
if (i === 500) return
window.requestAnimationFrame(loop);
})();
При быстром движении мыши события mouseover, mousemove, mouseout могут пропускать промежуточные элементы.связано с Вашей задачей и кодом? Вот вам пример "лупы" link. Есть какие-то "скачки"? Код по ссылке предоставлен - исправляйте свой.
random_id Unique identifier to avoid resending the message.
int (number), accessible for versions from 5.45
vk.messages.send(
user_id=event.user_id,
message='No results'
)
vk.method('messages.send', {
'user_id': user_id,
'message': msg,
'random_id': random_id
})
document.getElementById('overlay').style='visibility:hidden;opacity:0;transition:all 0.7s ease-out 0s';
th.trigger("reset");
на код выше....
$('#thanks').fadeIn(500);
setTimeout(function() {
// Done Functions
// th.trigger("reset");
document.getElementById('overlay').style='visibility:hidden;opacity:0;transition:all 0.7s ease-out 0s';
}, 1000);
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
console.log(obj[key]); // print all object items
};
}
const countInt = parseInt(count);
// or
const count = parseInt($( "#add_favorite_video_lbl" ).text());
SSH will fail to start if there are syntax errors in the /etc/ssh/sshd configuration file. The command following command will tell you if any directives are incorrect:/usr/sbin/sshd -T
If the configuration test does not return any errors, I would suggest starting sshd in debugging mode, this will provide you with a detailed startup of the service:/usr/sbin/sshd -ddd