jQuery('#chatx').addClass(localStorage.toggled);
jQuery('.chxicon-unmute, .chxicon-mute').on('click', function() {
jQuery(this).toggleClass("chxicon-unmute chxicon-mute");
if (jQuery(this).hasClass('chxicon-mute')) {
localStorage.setItem('soundMuted', '1');
} else {
localStorage.removeItem('soundMuted');
}
});
Авиация
Сообщений 71 страница 80 из 134
Поделиться712023-01-24 05:58 pm
Поделиться722023-01-24 06:14 pm
document.querySelector('#chatx').classList.add(localStorage.toggled);
document.querySelectorAll('.chxicon-unmute, .chxicon-mute').forEach(el => {
el.addEventListener('click', function() {
this.classList.toggle("chxicon-unmute");
this.classList.toggle("chxicon-mute");
if (this.classList.contains('chxicon-mute')) {
localStorage.setItem('soundMuted', '1');
} else {
localStorage.removeItem('soundMuted');
}
});
});
Поделиться732023-01-24 06:21 pm
jQuery(document).ready(function() {
jQuery(window).unload(saveNickname);
});function loadNickname() {
if (!sessionName) {
jQuery('#false_shoutbox_name').val(localStorage.nameElement);
}
}function saveNickname() {
localStorage.nameElement = jQuery('#false_shoutbox_name').val();
}
Поделиться742023-01-24 06:22 pm
document.addEventListener("DOMContentLoaded", function() {
window.addEventListener("beforeunload", saveNickname);
});function loadNickname() {
if (!sessionName) {
document.querySelector('#false_shoutbox_name').value = localStorage.nameElement;
}
}function saveNickname() {
localStorage.nameElement = document.querySelector('#false_shoutbox_name').value;
}
Поделиться752023-01-24 06:23 pm
document.addEventListener("DOMContentLoaded", () => window.addEventListener("beforeunload", saveNickname));
const loadNickname = () => !sessionName && (document.querySelector('#false_shoutbox_name').value = localStorage.nameElement);
const saveNickname = () => localStorage.nameElement = document.querySelector('#false_shoutbox_name').value;
Поделиться762023-01-24 06:34 pm
const textarea = document.getElementById('shoutbox-comment');
textarea.addEventListener('input', function() {
this.rows = 2;
this.rows = countRows(this.scrollHeight);if (this.rows >= 6) {
jQuery('.chx-pre-textarea, #chx-new-message').addClass("scrollable");
} else {
jQuery('.chx-pre-textarea, #chx-new-message').removeClass("scrollable");
}
if (!jQuery('.shoutbox-form').visible()) {
if (jQuery('.chx-container').height() > 360) {
let calcFormHeight = jQuery('.chx-container').height() - 18;
jQuery('.chx-container').css("height", calcFormHeight + "px");
localStorage.setItem(chx_resize, '{"height":"' + calcFormHeight + 'px"}');
} else {
let top = parseInt(jQuery('#chatx').css('top'), 10);
jQuery('#chatx').css('top', top - 18 + 'px')}
}
});
Поделиться772023-01-24 06:36 pm
const textarea = document.getElementById('shoutbox-comment'); textarea.addEventListener('input', function() { this.rows = 2; this.rows = countRows(this.scrollHeight); const elements = document.querySelectorAll('.chx-pre-textarea, #chx-new-message'); if (this.rows >= 6) { elements.forEach(el => el.classList.add("scrollable")); } else { elements.forEach(el => el.classList.remove("scrollable")); } if (!document.querySelector('.shoutbox-form').visible()) { if (document.querySelector('.chx-container').clientHeight > 360) { let calcFormHeight = document.querySelector('.chx-container').clientHeight - 18; document.querySelector('.chx-container').style.height = calcFormHeight + "px"; localStorage.setItem(chx_resize, '{"height":"' + calcFormHeight + 'px"}'); } else { let top = parseInt(document.querySelector('#chatx').style.top, 10); document.querySelector('#chatx').style.top = top - 18 + 'px'; } } });
Поделиться782023-01-24 06:49 pm
const isVisible = (elem) => !!elem && !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
if (!isVisible(document.querySelector('.shoutbox-form'))) {
//rest of the code
}
Поделиться792023-01-24 06:52 pm
const textarea = document.getElementById('shoutbox-comment');
textarea.addEventListener('input', function() {
this.rows = 2;
this.rows = countRows(this.scrollHeight);const elements = document.querySelectorAll('.chx-pre-textarea, #chx-new-message');
if (this.rows >= 6) {
elements.forEach(el => el.classList.add("scrollable"));
} else {
elements.forEach(el => el.classList.remove("scrollable"));
}if (!isVisible(document.querySelector('.shoutbox-form'))) {
if (document.querySelector('.chx-container').clientHeight > 360) {
let calcFormHeight = document.querySelector('.chx-container').clientHeight - 18;
document.querySelector('.chx-container').style.height = calcFormHeight + "px";
localStorage.setItem(chx_resize, '{"height":"' + calcFormHeight + 'px"}');
} else {
let top = parseInt(document.querySelector('#chatx').style.top, 10);
document.querySelector('#chatx').style.top = top - 18 + 'px';
}
}
});
Поделиться802023-01-24 06:53 pm
const isVisible = (elem) => !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
Быстрый ответ
Похожие темы
Космос | Обои для рабочего стола | 2025-01-03 |