• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Active tab or menu

#1
why is it when i select one tab even the other gets highlighted like it is in the image attached.
I mean I've five menu/tabs;
Fee type
Expense Type
Invoice
Payment History
Expense
but when i select "Expense Type" and gets highlighted even "Expense" get highlighted the same case applies to "Expense"
I've tried to go through that problem but I've failed, any suggestion please.


Attached Files Thumbnail(s)
   
Reply

#2
Without any code we could only guess
Reply

#3
If you're using ajax, you can use javascript to set a current tab to have a class.

Using php, you can use a conditional statement to check a url for a tab that needs to be highlighted. For example

Code:
<ul class="list-inline">
 <li class="<?= is_current_url(current_url()) ? 'active' : '' ?>">
    my tab one
 </li>

 <li class="<?= is_current_url(current_url()) ? 'active' : '' ?>">
    my tab two
 </li>
</ul>

You'll have to write the is_current_url() function, but that should work for you.

I would recommend using both javascript and the php method so your tabs work regardless of whether or not you're using Ajax
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply

#4
Maybe expense type and expense share the same tab ID.
But without any code this is pure guess work.
On the package it said needs Windows 7 or better. So I installed Linux.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.