jQuery.fn.extend({
equalHeights: function() {
var maxHeight = 0;
for (var i = 0; i < this.length; ++i) {
if (maxHeight < this.eq(i).height()) {
maxHeight = this.eq(i).height();
}
}
for (var i = 0; i < this.length; ++i) {
this.eq(i).height(maxHeight);
};
return this;
}
});
<button>Воспроизведение</button>
$('#player').on('play', function() {
//Меняем текст кнопки на "Пауза"
});
$('#player').on('pause', function() {
//Меняем текст кнопки на "Воспроизвести"
});
if($('#player').paused) {
$('#player').play();
} else {
$('#player').pause();
}
$(document).ready(function(){
$(window).scroll(function(){
var headerHeight = $('.slider').height();
if ($(this).scrollTop() >headerHeight) {
$('.header').addClass("fixed");
} else {
$('.header').removeClass("fixed");
}
});
});
.fixed {
position:fixed;
top: 0;
left: 0;
right: 0;
}
Note: This method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed.
cd ~/
touch backup.sh
chmod +x backup.sh
#!/bin/bash
# rsync - лучше, чем cp по ряду причин, в т.ч. потому что не копирует все файлы перебором, что существенно экономит время/ресурсы.
# Строка ниже - синхронизация папки /var/www и /mnt/yandexdisk/www, данные синхронятся ИЗ /var/www.
rsync -az --delete -e /var/www/ /mnt/yandexdisk/www/
rsync -az --delete -e /var/public/ /mnt/yandexdisk/public/
# и т.д. все что нужно копировать.
# дальше можете выполнять доп.команды типа уведомления на почту, архивации, дампов БД и т.п.
echo "00 03 * * * root ~/backup.sh" >> /etc/crontab
echo " " >> /etc/crontab
.header
.header__logo
.logo
.header__phone
.phone
.header__social
.social
.social__link .social__link--instagram
.social__link .social__link--vkontakte
.social__link .social__link--facebook
.header__menu
.menu
.menu__item .menu__item--active
.menu__item
.menu__item