daily pastebin goal
79%
SHARE
TWEET

Untitled

a guest Feb 12th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if ($("li.nav-item").length == 0) {
  2.             $('span.divider').remove();
  3.         }
  4.         if ($("li.nav-item").length > 0 && $("li.nav-item").is(':visible')) {
  5.             $('<span class="divider"> | </span>').appendTo('li.nav-item');
  6.         }
  7.    
  8. <ul id="navigation">
  9.                 <li class="nav-item"><asp:HyperLink ID="link1" runat ="server" Text="LoremIpsum"      NavigateUrl="#" /></li>
  10.                 <li class="nav-item"><asp:LinkButton ID="LoremIpsum" runat ="server" Text="LoremIpsum" PostBackUrl="~/#.aspx"  /></li>
  11.                 <li class="nav-item"><asp:HyperLink ID="link2" runat="server"  Text="LoremIpsum" NavigateUrl="#.aspx"/></li>
  12.                 <li class="nav-item"><asp:HyperLink ID="linkLogin" runat="server" Text="Login" NavigateUrl="~/login.aspx"/></li>
  13.                 <li class="nav-item"><asp:HyperLink ID="linkProfile" runat="server" Text="Profile" NavigateUrl="~/profile.aspx" Visible="false"/></li>
  14.                 <li class="nav-item"><asp:HyperLink ID="linkLogout" runat="server" Text="Logout" NavigateUrl="~/logout.aspx" Visible="false"/></li>
  15.                 <li><asp:HyperLink ID="LoremIpsum" runat="server" Text="LoremIpsum" NavigateUrl="~/nutzungsbedingungen.aspx"/></li>
  16.                 </ul>
  17.  
  18.  
  19. if (Session["svar_loggedin"] != null)
  20.     {
  21.         linkLogin.Visible = false;
  22.         linkProfile.Visible = true;
  23.         linkLogout.Visible = true;
  24.     }
  25.     else
  26.     {
  27.         linkLogin.Visible = true;
  28.         linkProfile.Visible = false;
  29.         linkLogout.Visible = false;
  30.     }
  31.    
  32. $.each($("li.nav-item").children("a").filter(":visible"), function (e) {
  33.     $('<span class="divider"> | </span>').appendTo($(this));
  34. });
  35.    
  36. linkLogin.Attributes.Add("style", "display:none")
  37.    
  38. $(function () {
  39.         var elements = $('li.nav-item > a').filter(':visible');
  40.         for (var i = 0; i < elements.length - 1; i++) {
  41.             elements.eq(i).append($('<span class="divider"> | </span>'));
  42.         }
  43.  
  44.     });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top