Например:
Четверг, 18.04.2024, 16:49 Регистрация Карта сайта RSS Лента
Игровые новости Топ Сайтов Статьи Загрузить изображение Игровой форум Картинки
  • Страница 1 из 1
  • 1
Форум » Система Ucoz » Скрипты от GaMe Portals » Сворачиваемая админ панель с функцией запоминания на jQuery
Сворачиваемая админ панель с функцией запоминания на jQuery
Dimas777
Дата: Воскресенье, 08.09.2013, 16:31 | Сообщение № 1
ICQ пользователя:
Skype пользователя:
Сайт пользователя:

Оффлайн
Сообщений: 300
Награды: 2
 


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

Установка:

После /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>  
   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[i];   
   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);  
   };  
   });  
   });  

</script>

    
Game-Portals.3dn.ru - The Best.
Форум » Система Ucoz » Скрипты от GaMe Portals » Сворачиваемая админ панель с функцией запоминания на jQuery
  • Страница 1 из 1
  • 1
Поиск: