| [Мой сайт] |
| Форма входа |
| Меню сайта |
| Categories | |||||||
|
| Главная » Файлы » Всё для uCoz » Скрипты для uCoz |
| 02.01.2012, 21:10 | |
| Полезный и красивый скрипт для Вашего uCoz сайта. При наведении на строку форума, появляется количество "Тем", "Ответов", "Автора темы". Без наведения строка пустует, если навести на строку, то плавно появится количество "Тем", "Ответов", "Автора темы", считаю что полезный скрипт для сайта uCoz. Вот этот код вставить в Общий вид страниц форума после $BODY$: Code <script type="text/javascript"> $('.gTable tr').each(function() { <?if($PAGE_ID$='main' || $PAGE_ID$='category')?>$('.forumDescr',this).before('<div class="uHover">' + $('.forumThreadTd',this).text() + declOfNum($('.forumThreadTd',this).text(), [' тема', ' темы', ' тем'])+ ' | ' +$('.forumPostTd',this).text()+declOfNum($('.forumPostTd',this).text(), [' ответ ', ' ответа ', ' ответов '])+'</div>'); $('.forumNameTd',this).hover(function(){$(this).find('.uHover:not(:animated)').fadeIn()},function(){$(this).find('.uHover').fadeOut()});<?endif?> <?if($PAGE_ID$='forum')?>$('.threadLink',this).before('<div class="uHover">' + $('.threadPostTd',this).text() + declOfNum($('.threadPostTd',this).text(), [' ответ', ' ответа', ' ответов'])+ ' | Автор: ' +$('.threadAuthTd span a',this).text())+'</div>'; $('.threadNametd',this).hover(function(){$(this).find('.uHover:not(:animated)').fadeIn()},function(){$(this).find('.uHover').fadeOut()});<?endif?> }); function declOfNum(number, titles) { cases = [2, 0, 1, 1, 1, 2]; return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; } </script> <style type="text/css"> .uHover {float:right;display:none;margin-right:5px;} .gTableSubTop:nth-child(3), .gTableSubTop:nth-child(4), .forumThreadTd, .forumPostTd, .threadViewTd, .threadPostTd, .threadAuthTd<?if($PAGE_ID$='forum')?>, .gTableSubTop:nth-child(5)<?endif?> {display:none} </style> | |
| Всего комментариев: 0 | |