Всем привет, недавно на нескольких сайтах я увидел одну статистику, и вспомнил, что я делал что-то подобное когда делал данный шаблон, решив поковыряться в стары файлах своего компьютера, я нашел его - новы вид статистики.
А вообще идея реализации данного скрипта мне пришла когда я ходил по всяким бизнес сайтам, где красиво появляются цифры от одного и до тысяч как раз в кружочках, вот я и делал для своего сайта, потом все пере игралось и я статистику вставил в блок а про эту забыл, думал вообще удалил, но теперь я выставляю ее в паблик))
Данный вид статистики очень красивый и функциональный, и вот его возможности:
1) Фиксированная позиция в правом нижнем углу сайта по верх всех окон.
2) Работоспособность скрипта на любых страницах сайта даже на странице личных сообщений при условии активированного модуля форум.
3) Красивое появление цифр от нуля и до того числа сколько в текущий момент пользователей (p.s. если у вас на сайте один два человека, то красивое появление видно не будет).
4) Можете в комментариях написать и я дополню скрипт разными прибамбасами))
Но а теперь к установке: Вставляем данный код на любой странице перед </body>:
Код
<style>
.wStatistic {position:fixed; bottom:10px; right:-5px; z-index:9999;}
.wRing {border:2px solid; width:30px; line-height:30px; text-align:center; font-size:14px; -moz-border-radius: 60px; -webkit-border-radius: 60px; -khtml-border-radius: 60px; border-radius: 60px; behavior: url(border-radius.htc);}
.wOnlain {background:#eeffdd; border-color: #66cc00;color: #66cc00;}
.wOurs {background:#ddeeff; border-color: #0066cc;color: #0066cc;}
.wForeign {background:#ffdddd; border-color: #cc0000;color: #cc0000;}
#wOnlain span {visibility:hidden; position:absolute; bottom:41px; right:117px; z-index:999; width:auto; margin-left: -127px; padding:2px 4px; border: 2px solid #000; opacity: 0.9; background-color:#000; -moz-border-radius:4px; border-radius:4px; cursor:auto; color:#fff;}
#wOnlain:hover {border:0;}
#wOnlain:hover span {visibility:visible;}
#wOnlain span:before, #wOnlain span:after {content: ""; position:absolute; z-index:1000; bottom:-7px; left:50%; margin-left:-8px; border-top:8px solid #000000; border-left:8px solid transparent; border-right:8px solid transparent; border-bottom:0;}
#wOurs span {visibility:hidden; position:absolute; bottom:41px; right:67px; z-index:999; width:auto; margin-left: -127px; padding:2px 4px; border: 2px solid #000; opacity: 0.9; background-color:#000; -moz-border-radius:4px; border-radius:4px; cursor:auto; color:#fff;}
#wOurs:hover {border:0;}
#wOurs:hover span {visibility:visible;}
#wOurs span:before, #wOurs span:after {content: ""; position:absolute; z-index:1000; bottom:-7px; left:50%; margin-left:-8px; border-top:8px solid #000000; border-left:8px solid transparent; border-right:8px solid transparent; border-bottom:0;}
#wForeign span {visibility:hidden; position:absolute; bottom:41px; right:14px; z-index:999; width:auto; margin-left: -127px; padding:2px 4px; border: 2px solid #000; opacity: 0.9; background-color:#000; -moz-border-radius:4px; border-radius:4px; cursor:auto; color:#fff;}
#wForeign:hover {border:0;}
#wForeign:hover span {visibility:visible;}
#wForeign span:before, #wForeign span:after {content: ""; position:absolute; z-index:1000; bottom:-7px; left:50%; margin-left:-8px; border-top:8px solid #000000; border-left:8px solid transparent; border-right:8px solid transparent; border-bottom:0;}
</style>
<div class="wStatistic">
<div id="wOnlain" style="float:left; margin-right:20px;"><span>Онлайн</span><div class="wRing wOnlain" id="visitors">0</div></div>
<div id="wOurs" style="float:left; margin-right:20px;"><span>Наших</span><div class="wRing wOurs" id="members">0</div></div>
<div id="wForeign" style="float:left; margin-right:20px;"><span>Чужих</span><div class="wRing wForeign" id="guests">0</div></div>
</div>
<script>
$.get('/forum ',function(data){
var statistics = [$('.gTable:last .gTableSubTop b:first',data).html(), $('.gTable:last .gTableSubTop b + b',data).html(), $('.gTable:last .gTableSubTop b',data).eq(2).html()]
// Онлайн
$({numberValue: $('#visitors').text()}).animate({numberValue: statistics[0]}, {
duration: 1000,
easing: 'linear',
step: function() {
$('.wOnlain').text(Math.ceil(this.numberValue));
}
});
// Авторизованных
$({numberValue: $('#members').text()}).animate({numberValue: statistics[1]}, {
duration: 1000,
easing: 'linear',
step: function() {
$('#members').text(Math.ceil(this.numberValue));
}
});
// Гостей
$({numberValue: $('#guests').text()}).animate({numberValue: statistics[2]}, {
duration: 1000,
easing: 'linear',
step: function() {
$('#guests').text(Math.ceil(this.numberValue));
}
});
}); /*by webo4ka.ru - удалять источник запрещено!!!*/
</script>
На этом все, не забываем отписаться о работе скрипта...