AdminBSBMaterialDesign icon indicating copy to clipboard operation
AdminBSBMaterialDesign copied to clipboard

Sidebar li active not change

Open argigentarna opened this issue 6 years ago • 1 comments

Hai, my name is Argi. Please I Need Help.

I use this in Codeigniter. But In sidebar menu when i click the other menu, the li menu not active

screen shot 2018-04-17 at 12 53 15

This my code :

  • home HOME
  • db->get_where('tabel_menu_admin',array('parent'=>0))->result(); foreach ($main as $m ){ // chek ada submenu atau tidak $sub=$this->db->get_where('tabel_menu_admin',array('parent'=>$m->menu_id)); if($sub->num_rows()>0){ // looping submenu echo "
  • assignment "; echo strtoupper($m->nama_menu); // echo anchor('javascript:void(0);', ' '.strtoupper($m->nama_menu).' '); echo "
      "; foreach ($sub->result() as $s){ echo '
    • '.anchor('admin/'.$s->link,' '.$s->icon.' '.strtoupper($s->nama_menu)).'
    • '; } echo "
    "; echo "
  • "; }else{ // echo '
  • '.anchor('admin/'.$m->link,' '.strtoupper($m->nama_menu)).'
  • '; echo '
  • '.anchor('admin/'.$m->link,' '.$m->icon.' '.strtoupper($m->nama_menu)).'
  • '; } }?>

    Thanks for attention

    argigentarna avatar Apr 17 '18 05:04 argigentarna

    Hello,

    You need to add class='active' to your parent li and the child for every page.
    untitled

    dheroefic avatar Apr 17 '18 07:04 dheroefic