![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 681 Pomógł: 28 Dołączył: 14.08.2014 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
Chciałbym to zmodyfikować w ten sposób aby, po wybraniu taba i odświeżeniu strony pamiętało który tab był wczytany. Zrobiłem póki co tak: mam kod:
Rozumiem, że teraz powinienem zrobić coś na styl : select: function(event, ui) { window.location.replace(ui.tab.hash); } Ale za cholerę nie mogę sobie z tym poradzić. Ten post edytował casperii 21.05.2015, 19:58:15 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 1 268 Pomógł: 254 Dołączył: 11.06.2009 Skąd: Świętochłowice Ostrzeżenie: (0%) ![]() ![]() |
Eh, ja o A, a Ty o B… (IMG:style_emoticons/default/wink.gif)
elem.click() vs elem.on('click', function() {[…]}) - widać różnicę? Kod if(location.hash) $('[data-tab=' + location.hash + ']').click(); Łap cały kod JS: Kod $(function (){
$('[data-tab]').on('click', function (e){ var that = $(this); var parent = that.parent().parent().parent(); var url = location.pathname + that.data('tab'); var hash = url.substring(url.indexOf('#')); window.location.replace(url); that .addClass('active') .siblings('[data-tab]') .removeClass('active'); $('[data-content]',parent) .removeClass('active') .siblings('[data-content=' + that.data('tab') + ']') .addClass('active'); e.preventDefault(); //alert('zobacz' + url); }); if(location.hash) $('[data-tab=' + location.hash + ']').click(); }); |
|
|
![]() ![]() |
![]() |
Aktualny czas: 16.10.2025 - 19:18 |