开发者

jQuery plugin which allows drop down menu like google translate

I like a lot the drop down menu of google translate that allow开发者_如何学编程 to choose languages (from -> to). It gives you a quick overview of all languages (options) available and it indicates with different colors the history of your choice. http://translate.google.com/

I'm wondering if hopefully, anyone knows a jQuery plugin to transform a simply select in a drop down menu which looks like the google translate select. Thanks,

Antonio


You don't really need a plugin, just some CSS positioning and use JS to show/hide the section on click.

HTML:

<div id="my_button">Click me!</div>

<div id="mega_menu">
    <ul>
        <li>...</li>
    </ul>
</div>

CSS:

#mega_menu { display:none; left:50px; position:absolute; top:50px; }
/* Position as necessary */

JavaScript:

$('#my_button').bind('click', function( e ) {

    e.preventDefault();

    var menu = $('#mega_menu');

    if ( menu.is(':visible') )
    {
        menu.fadeOut();
    }
    else
    {
        menu.fadeIn();
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜