Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Alternave Animated Menuing System (Suckerfish based)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
eclifter  
View profile  
 More options Dec 8 2008, 2:51 pm
From: eclifter <eclif...@gmail.com>
Date: Mon, 8 Dec 2008 11:51:17 -0800 (PST)
Local: Mon, Dec 8 2008 2:51 pm
Subject: Alternave Animated Menuing System (Suckerfish based)
I am working on a menu alternative using Ojay that degrades better for
browsers with JS disabled.  It is a variation of Suckerfish that I
call Koi.  I haven't tested it in all browsers yet but I do see some
intermittent issues with the animation, perhaps because I haven't
found a way to stop an animation on a node before starting a new one.
I'm releasing the code under the BSD License.  Any help in fixing the
intermittent animation errors or improving it in any way would be
greatly appreciated.

koi.js
<---------------------------------------------------------->
/*
Copyright (c) 2008 the WebFeat Media LLC
Licensed under the BSD license
Version: 0.1.0
*/
var Menu = new JS.Class({
    initialize: function(el, options){

        var Event = YAHOO.util.Event, Dom = YAHOO.util.Dom,
                container               = $(el),

                        topmenu                 = $('ul#nav'),
                        submenus                = $('ul#nav ul'),

                        hidden                  = {
                                                                visibility: 'hidden',
                                                                                          display:
'none'
                                                        },

                        show                    = {
                                                                visibility: 'visible',
                                                                display: 'block'
                                                        },

                        hoverClass              = 'koiHover',
                        subClass                = 'submenu',
                        hoverSelector   = '.' + hoverClass,

                        delay                   = 0.5;

        submenus.forEach(function(menu, i){
                        menu.node.koiHeight = menu.getHeight();
                        menu.node.koiWidth = menu.getWidth();
        });

        submenus
                .setStyle(hidden)
                .parents('li')
                        .addClass(subClass);

        topmenu
       .on('mouseover', $.delegateEvent({
            'li': function(item, event){
                event.stopEvent();
                var siblingSubs = item.siblings(hoverSelector);

                if (!siblingSubs)
                    return;

                siblingSubs
                                .removeClass(hoverClass)
                                .children('ul')
                                        .setStyle(hidden);
            },
            'li.submenu': function(submenu, event){
                event.stopEvent();
                if (submenu.hasClass(hoverClass))
                    return;

                submenu.addClass(hoverClass);
                                var menu = submenu.children('ul');

                menu
                                .setStyle(show)
                                .animate({
                    height: {
                                                from: 0,
                        to: menu.node.koiHeight
                    }
                }, delay, {
                    easing: 'bounceOut',
                    before: it().setStyle({
                                                height: '0',
                                                overflow: 'hidden'
                                        }),
                    after: it().setStyle({
                                                overflow: '',
                                                height: ''
                                        })
                });
            }
        }, true))
                .on('mouseout', function(submenu, event){
            event.stopEvent();

            if (Dom.isAncestor(container.node, Event.getRelatedTarget
(event)))
                return;

            submenu.descendants(hoverSelector)
                                .removeClass(hoverClass)
                                .children('ul')
                                        .setStyle(hidden);
        });
    }

});

<-------------------------------------------------------------------------- -------------------------------------


And then the HTML - I split up the required CSS from the formatting
CSS for easy in identifying what must be changed.

index.html
<-------------------------------------------------------------------------- -------------------------------------


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!--CSS file (default YUI Sam Skin) -->
        <link type="text/css" rel="stylesheet" href="http://
yui.yahooapis.com/2.6.0/build/logger/assets/skins/sam/logger.css">
        <style type="text/css">
            body {
                font-family: arial, helvetica, serif;
            }
                        #nav, #nav * { /* all lists */
                                list-style-image:none;
                                list-style-position:outside;
                                list-style-type:none;
                                margin:0;
                                padding:0;
            }
                        #nav a {
                display: block;
            }
                        #nav li { /* all list items */
                float: left;
                                width: 10em;
            }
                        #nav li ul { /* second-level lists */
                position: absolute;
                width: 10em;
                left: -999em;
            }
                        #nav li ul ul {
                margin: -2.5em 0 0 10em;
                                z-index:99;
            }
                        #nav li:hover > ul {
                left: auto;
            }
                        #nav .koiHover {
                left: auto;
            }
                        #nav li:hover {
                position: static;
            }

                        #nav {
                                float: left;
                                margin-bottom: 1em;
                        }
                        #nav {
                                line-height: 1em;
                        }
                #nav li {
                        background:#BDD2FF none repeat scroll 0 0;
                }
                        #nav li li {
                                background:#AABDE6 none repeat scroll 0 0;
                        }
                        #nav a, #nav a:visited {
                                color: #1133AA;
                        }
                        #nav a {
                                border-left:1px solid #FFFFFF;
                                border-top:1px solid #CFDEFF;
                                padding:0.75em 1em;
                                text-decoration:none;
                        }
                        #nav li:hover, #nav li.koiHover {
                                background:#CFDEFF none repeat scroll 0 0;
                        }
        </style>
        <title>Drop me Down!</title>
    </head>
    <body>
        <div>
            <p>
                Below is a DDM which has two multilevel options.
Follow the options other than "Test Item" and you should reach the
furthest level with a link called "No More Sub Menus".
            </p>
            <p>
                This example uses normal javascript to catch out the
browsers that don't support the CSS E > F and :hover selectors.
            </p>
        </div>
        <div id="horiz-menu">
            <ul id="nav">
                <li>
                    <a href='#'>Menu Item 1</a>
                    <ul>
                        <li>
                            <a href='#'>Test Item</a>
                        </li>
                        <li>
                            <a href='#'>Test Item</a>
                        </li>
                        <li>
                            <a href='#'>Test Item</a>
                        </li>
                        <li>
                            <a href='#'>Go a little further</a>
                            <ul>
                                <li>
                                    <a href='#'>Test Item</a>
                                </li>
                                <li>
                                    <a href='#'>And More</a>
                                    <ul>
                                        <li>
                                            <a href='#'>Test Item</a>
                                        </li>
                                        <li>
                                            <a href='#'>And Even More!
</a>
                                            <ul>
                                                <li>
                                                    <a href='#'>Test
Item</a>
                                                </li>
                                                <li>
                                                    <a href='#'>WOW
THIS IS CRAZY!</a>
                                                    <ul>
                                                        <li>
                                                            <a
href='#'>Test Item</a>
                                                        </li>
                                                        <li>
                                                            <a
href='#'>GENIUS!</a>
                                                            <ul>
                                                                <li>
                                                                    <a
href='#'>No More Sub Menus</a>
                                                                </li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href='#'>
                        Menu Item 2
                    </a>
                    <ul>
                        <li>
                            <a href='#'>Test Item</a>
                        </li>
                        <li>
                            <a href='#'>Here too</a>
                            <ul>
                                <li>
                                    <a href='#'>Test Item</a>
                                </li>
                                <li>
                                    <a href='#'>And More</a>
                                    <ul>
                                        <li>
                                            <a href='#'>Test Item</a>
                                        </li>
                                        <li>
                                            <a href='#'>And Even More!
</a>
                                            <ul>
                                                <li>
                                                    <a href='#'>Test
Item</a>
                                                </li>
                                                <li>
                                                    <a href='#'>No
More Sub Menus</a>
                                                </li>
                                            </ul>
                                        </li>
...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
eclifter  
View profile  
 More options Dec 8 2008, 2:59 pm
From: eclifter <eclif...@gmail.com>
Date: Mon, 8 Dec 2008 11:59:17 -0800 (PST)
Local: Mon, Dec 8 2008 2:59 pm
Subject: Re: Alternave Animated Menuing System (Suckerfish based)
I would be remiss if I did not note that the inspiration for the CSS
and HTML come from here: http://blog.netweblogic.com/css/suckerfish-drop-down-menu-improved/

On Dec 8, 1:51 pm, eclifter <eclif...@gmail.com> wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »