javascript - Sidebar menu Navigation hiding for user based login -
i want login specific side bar menu users on html page, admin users should 4 5 sidebar menu users there 1 static menu, wrote jquery hide side bar, didn't work can guys`
<aside class="main-sidebar"> > <!-- sidebar: style can found in sidebar.less --> > <section class="sidebar"> > <ul class="sidebar-menu"> > <li class="active treeview"> <p hidden id="munhome"> <a href="home.html"> <i class="fa fa-home"></i> > <span>home</span></a></p></li> > <li class="treeview"> <a href="chart.html"> <i class="fa fa-line-chart"></i> <span>graphs</span> </a></li> > <li class="treeview"> <p hidden id="munviewcontroller"> <a href="view-controller.html"> <i class="fa > fa-eye"></i> <span>view controllers</span></a></p></li> > <li class="treeview"> <p hidden id="munviewuser"><a href="view-users.html"> <i class="fa fa-users"></i> <span>view > users</span></a></p></li> > </ul> > </section> > <!-- /.sidebar --> > </aside>
help me? attached jquery
jquery(document).ready(function($) { if(sessionstorage.getitem("susername")){ var username=sessionstorage.getitem("susername"); var susertype=sessionstorage.getitem("susertype"); if(susertype=="2" || susertype=="1") { $( "#munhome" ).show(); $( "#munviewcontroller" ).show(); $( "#munviewuser" ).show(); //document.getelementbyid('btnadduser').style.visibility = 'visible'; adduserviaajax(); } $("#displayusername").text(username); } else{ window.location.href = "./"; } });
Comments
Post a Comment