[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Форум » Ucoz » Скрипты для ucoz » Сворачиваемая панель с функцией запоминания на jQuery и CSS3
Сворачиваемая панель с функцией запоминания на jQuery и CSS3
offtop
Дата: Суббота, 18.05.2013, 20:38 | Сообщение # 1
Оффлайн
Пользователи
Сообщений: 216
IP: Скрытная информация


Данный скрипт добавит админ панели вашего сайта функцию сворачивания при клике по полоске под ней

Установка:

После </head> на нужных страницах вставляйте:

Код
<style>
.cuzadpn, .subapoadminpanel {
-o-transition:margin-top .3s ease;
-webkit-transition:margin-top .3s ease;
-moz-transition:margin-top .3s ease;
}
#puzadpn {
-o-transition:height .3s ease;
-webkit-transition:height .3s ease;
-moz-transition:height .3s ease
}
.subapoadminpanel {
width: 100%;
height: 7px;
position: fixed;
background: rgb(200, 200, 200);
z-index: 999;
margin-top: 24px;
box-shadow: 0px 1px 3px #777;
cursor:pointer;
}
.subapoadminpanel:hover {
background: rgb(190, 190, 190);
}
</style>
<script>
// dedicated.3dn.ru
function setCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
else var expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca;
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
function eraseCookie(name) {
setCookie(name, "", -1);
};

$(document).ready(function() {
$('#puzadpn').before('<div class="subapoadminpanel"></div>');
if(getCookie('hideapoadmin')) {
$('#puzadpn').attr('style', 'height:0px;');
$('.cuzadpn').attr('style', 'margin-top:-24px;');
$('.subapoadminpanel').attr('style', 'margin-top:0px;');
apohider = 1;
} else {
apohider = 0;
$('#puzadpn').attr('style', 'height:24px;');
$('.cuzadpn').attr('style', 'margin-top:0px;');
$('.subapoadminpanel').attr('style', 'margin-top:24px;');
}

$('.subapoadminpanel').click(function() {
if(apohider == 1) {
apohider = 0;
$('#puzadpn').attr('style', 'height:24px;');
$(this).attr('style', 'margin-top:24px;');
$('.cuzadpn').attr('style', 'margin-top:0px;z-index:' + _uWnd.getTopZ());
eraseCookie('hideapoadmin');
}
else
{
apohider = 1;
$('#puzadpn').attr('style', 'height:0px;');
$(this).attr('style', 'margin-top:0px;');
$('.cuzadpn').attr('style', 'margin-top:-24px;');
setCookie('hideapoadmin', 1, 365);
};
};);
};);

// ApoTeam (c) 2013
</script>
Прикрепления: 3858471.png (50.7 Kb)


Сообщение отредактировал offtop - Суббота, 18.05.2013, 20:39
Форум » Ucoz » Скрипты для ucoz » Сворачиваемая панель с функцией запоминания на jQuery и CSS3
  • Страница 1 из 1
  • 1
Поиск: