Skip to content

Instantly share code, notes, and snippets.

View mtvphnx's full-sized avatar
:octocat:
Busy procrastinating

Matvey Phoenix mtvphnx

:octocat:
Busy procrastinating
View GitHub Profile
@Mons1eurEnzo
Mons1eurEnzo / common.js
Last active June 5, 2021 20:06
Bitrix Panel fixed (Фиксим плавающую панель сайта и панель админки Битрикса)
BX.ready(function () {
var MyPanel = BX("navmenu"), // ID ShowPanel Bitrix
BxPanel = BX.admin.panel,
FxPanel = function () {
if (window.pageYOffset >= BxPanel.DIV.clientHeight && BxPanel.isFixed() === false) {
MyPanel.style.top = 0;
} else if (BxPanel.isFixed() === true) {
MyPanel.style.top = BxPanel.DIV.clientHeight + "px";
} else {
MyPanel.style.top = BxPanel.DIV.clientHeight - window.pageYOffset + "px";