Класс .active для активного блока div
Как сделать что бы ссылкам <a href='javascript://'>[1]</a> добавлялся класс активности данной клавиши, спасибо. :help:
<div class='tabs'> <a href='javascript://'>[1]</a> <a href='javascript://'>[2]</a> <a href='javascript://'>[3]</a> <a href='javascript://'>[4]</a> <a href='javascript://'>[5]</a> <a href='javascript://'>[6]</a> <div>[1]</div> <div>[2]</div> <div>[3]</div> <div>[4]</div> <div>[5]</div> <div>[6]</div> </div> <script type='text/javascript'> jQuery(function ($) { var tabs = $("div.tabs"), children = tabs.children("div"), current = 0, len = children.length - 1; tabs.children("div:gt(0)").hide(); tabs.children("a").each(function (i) { this.eq = i; }).click(function () { clearInterval(timer); children.eq(current).hide(); current = this.eq; children.eq(current).show(); }); timer = setInterval(function () { children.eq(current).hide(); if (current === len) current = 0; else ++current; children.eq(current).show(); }, 3000); }); </script> |
dima_riabets,
а скрипт что делает? |
Цитата:
Ни у кого нет чистого кода слайдера табов с: - присваиваемым класом активного пункта - автопереключением - независимым расположением всех элементов слайдера, то есть "вперед" "назад", 1, 2, 3, 4, 5 - кнопки переключения и сами табы. :yes: |
dima_riabets,
http://bxslider.com/ |
Часовой пояс GMT +3, время: 11:48. |