2016-04-03 162 views
0

有沒有辦法來突出我的導航欄?:突出顯示當前標籤頁?

enter image description here

進出口使用多個標籤1個HTML文件中的當前選項卡。我的導航一小段代碼:

<div id="nav"> 
    <ul id="ulnone"> 
     <a href="#" class="navbutton" onclick="return show('fixed-tab-1');">Mijn Profiel</a> 
     <a href="#" class="navbutton" onclick="return show('fixed-tab-2');">Ranglijsten</a> 
     <a href="#" class="navbutton" onclick="return show('fixed-tab-3');">Voorspellingen!</a> 

回答

0

使用jQuery它可以是簡單的:

http://codepen.io/anon/pen/BKweBj

jQuery: 
    $(".tab").click(function() { 
    $(".tab").removeClass("active"); 
    $(this).addClass("active"); 
}); 

讓我知道,如果你不能使用jQuery不管是什麼原因

並與默認活動:

http://codepen.io/anon/pen/ONORmG

+0

謝謝,聽起來不錯!你能告訴我你使用的Java代碼嗎?對不起,我真的很糟糕在java –

+0

我用jQuery更新了我的答案:) – ExohJosh

+0

aah好吧,你能告訴我你的jQuery嗎? –