views:

1727

answers:

3

Hi there,

I was wondering if its possible for anyone to provide me with a guideline for creating a menu using jQuery that is similar to Telerik's MultiColumn RadMenu (http://demos.telerik.com/aspnet-ajax/menu/examples/multicolumnmenu/defaultcs.aspx). I am desperate to make this work, and I don't want to fork out a pot-load of money for a component suite. I am working on something using jQuery's hover(); function, but the menu containers don't wan to slide back up for some reason.

thanking u in advance!

A: 

Look into jQuery's UI tools. Given your use of Telerik, I am guessing you use ASP.NET or their MVC stuff. MS is looking to integrate jQuery into their stuff (ASP.NET AJAX Framework), so it'll pay off to get familiar with the whole she-bang. The Accordion widget, or the Slide Effect may be exactly what you are looking for.

ADDED: There is a Menu ui widget in the experimental branch, but for now, you'd be stuck rolling your own.

ADDED: Here's a plugin (jdMenu or droppy), if you prefer that road.

alphadogg
hi alphadogg! thanks for the advice. yes, im using ASP.NET version 3.5 of the framework. The accordion plugin didn't really work out too well , but I'll have a look at the slide effect. there's alos the Cycle plugin, but thats more for images. When I make some head-way I'l post back here. Thanks!
Shalan
hi alphadogg. Thanx for the plugin links! droopy looks like a great plugin to get started with, and may be just what Im looking for.I'll post back here with the results
Shalan
+2  A: 

This is for the click

<script type="text/javascript">
    $(document).ready(function() {

        $(".subMenu").hide();

        $(".btnJQUERYSubMenu").click(function() {
            $(this).next(".subMenu").slideToggle("fast");
            $(this).toggleClass("active");
            return false;
        });
    });
</script>

This is the other script for mouserover and mouseout

<script type="text/javascript">
        $(document).ready(function() {

            $(".subMenu").hide();

            $(".btnJQUERYSubMenu").mouseover(function() {
                $(this).next(".subMenu").slideToggle("fast");
                $(this).toggleClass("active")
            }).mouseout(function() {
                $(this).next(".subMenu").slideToggle("fast");
                $(this).toggleClass("active")
            });

            $(".subMenu").mouseout(function() {
                $(this).slideToggle("fast"); // or you can user hide instead of slideToogle. Something happens to css it might be about that i have css classes on testing
            });
        });
    </script>

<ul class="menu-panel">
    <li>
        <asp:HyperLink  runat="server" Text="Home"></asp:HyperLink>
    </li>
    <li>
        <asp:HyperLink ID="lnkSideMenuEstates" runat="server" Text="Estates" ></asp:HyperLink>
    </li>        
    <%--SubMenu--%>
    <li>
        <asp:HyperLink runat="server" Text="About Us" CssClass="btnJQUERYSubMenu plus" NavigateUrl="#"></asp:HyperLink>
        <div class="subMenu">
            <ul class="menu-panel paddingleft10">
                <li>
                    <asp:HyperLink runat="server" Text="Who are we"></asp:HyperLink>
                </li>                   
           </ul>
        </div>
    </li>
</ul>
Barbaros Alp
Hi Barbaros, thanx for the reply! This looks good, except that it needs to slide down on mouseover, and slide up on mouseout. I have tried using jQuery hover(); but when I mouseover another item, my first item disappears. Any clue?
Shalan
You are welcome, you need to use mouseover and mouseout function
Barbaros Alp
I have updated my answer about mouserover, please check it :)
Barbaros Alp
this looks fantastic, Barbaros! thanx! let me just apply some css to it and try it out!
Shalan
you are welcome :)
Barbaros Alp
Barbaros, it works like a charm! Thank you much for the assistance. With a bit of CSS magic,it looks, and functions great! But hereafter I need to become more familiar with jQuery. cheers!
Shalan
Sorry Barbaros, when I hover over the menu item, the container DOES slide down, but it slides back up when I hover over any point in the container (in other words, when I hover off the actual menu item that shows the container). thanx
Shalan
You are welcome :) I have tried to do it check my answer please
Barbaros Alp
HI Barbaros. Thanx for the reply. I was actually thinking of something in the "mouseout" event, to the effect of - if mouse "in" container boundaries, then don't slide back up, else slide back up. Is this possible? Im unsure how to tackle mouseover of container in this case :(
Shalan
A: 

I have created this also:

http://sarfraznawaz.wordpress.com/2010/03/13/creating-panel-menu-with-jquery/

Sarfraz