Welcome Guest, Not a member yet? Register   Sign In
Active tab or menu
#1

(This post was last modified: 07-25-2017, 07:56 AM by kayinja.denis.)

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

(This post was last modified: 07-25-2017, 09:35 AM by albertleao.)

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




Theme © iAndrew 2016 - Forum software by © MyBB