Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi I tried to drop down an icon bar but I am trying to write the script can you help to write multiple-drop down

What I have tried:

<pre><div class="icon-bar">

    <a class="" href="~/Home/Index" style="padding-bottom: 10px" id="home_btn">
        class="fa fa-home">
    </a>
    @if (Request.IsAuthenticated && Session["ActorID"] != null)
    {
        <div class="dropdown">

            <button class="dropbtn" id="btn">Online Applications ▼</button>
            <div class="dropdown-content">
                @*<a href="~/ProcessOnlineApps/Process" id="searchonlineApp">class="fa fa-address-card" href="~/Search/Search" id="search"> Search</a>*@
                <a href="~/ProcessOnlineApp/Process" id="search">^__i class="fa fa-address-card"> Process</a>
                @*<a href=@System.Web.Configuration.WebConfigurationManager.AppSettings["NewAppDev"]>class="fa fa-file" href="~/Searching/Search" id="search"> Search</a>
                <a href="~/LicensingPayment/Index" id="logout">^__i class="fa fa-angellist"> Payment Process</a>
            </div>

        </div>
    }

    @if (Request.IsAuthenticated && Session["ActorID"] != null)
    {
        <div class="dropdown" id="LinkLogout" style="position: absolute; right: 19px;">
            <button class="dropbtn" id="btn_MyAccount">@CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Session["UserName"].ToString().Split('\\')[1].Replace(".", " ").ToLower()) ▼</button>

            <div class="dropdown-content1">
                <a href="~/UserDocument/UserGuideDocument" id="UserGuide" target="_blank">class="fa fa-book"> User Guide</a>
                <a href="~/Home/Logout" id="logout">^__i class="fa fa-angellist"> Logout</a>

            </div>
        </div>
    }
    @if (Request.IsAuthenticated && Session["ActorID"] != null && Session["SysAdmin"] != null && (bool)Session["SysAdmin"])
    {
        <div class="dropdown">

            <button class="dropbtn" id="btn">IT Maintenance ▼</button>
            <div class="dropdown-content">
                @*<a href="~/ManageUsers/UserRoles" id="UserRoles">class="fa fa-address-card" href="~/Actor/Users_Process" id="UserRoles"__^ Users\Roles</a>
                <a href="~/Email/Index" id="UserRoles">^__i class="fa fa-address-card"> Email</a>
                @*<a href="~/PaymentSearc/PaymentSearc" id="UserRoles">^__i class="fa fa-address-card"> Payment Search</a>*@
                @* <a href="~/Search/Search" id="search">^__i class="fa fa-search"> Search</a>*@
            </div>

        </div>
    }


    @if (Request.IsAuthenticated && Session["ActorID"] != null)
    {
        <div class="dropdown">

            <button class="dropbtn" id="btn">Depatment Resources ▼</button>
            <div class="dropdown-content">
                <a href="~/DepartmentResources/AbcNeWCheckList" target="_blank" id="UserRoles">class="fa fa-address-card"> ABC New Emp Check List </a>
            </div>
        </div>
    }

    @if (Request.IsAuthenticated && Session["ActorID"] != null)
    { 
        <div class="dropdown">
            <button class="dropbtn" id="btn">Payment Search ▼</button>
            <div class="dropdown-content">
                <a href="~/PaymentSearc/PaymentSearc" id="UserRoles">class="fa fa-address-card" href="~/PaymentSearc/PaymentSearc" id="UserRoles"__^ Edit <br />
                <a id="UserRoles">^__i class="fa fa-address-card"> Refund</a><br />
                <a class="test" href="#"> Another dropdown <span class="dropbtn"></span></a>


                <a id="UserRoles"> ^__i class=".dropdown-submenu">Post</a>
                <a id="UserRoles"> ^__i class=".dropdown-submenu">Request</a>

            </div>
        </div>
    }
</div>
<script>
    $(document).ready(function () {
        $('dropdown-submenu a.test').on("click", function (e) {
            $(this).next('ul').toggle();
            e.stopPropagation();
            e.preventDefault();

        });

    });
</script>

<body>
Posted
Comments
Member 13812021 5-Jun-18 11:44am    
It would help to see JavaScript and css. I would think you should be using to correspond with the javascript so that it will drop down. You are showing a list of links.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900