luidgi27 luidgi27 - 6 months ago 22
Javascript Question

Menu Language like this one

I don't know if this is a "valid" question, so forgive me if it's not.
I wanted to make a language selector like the one in this webpage:

http://panicstation.pixelthrone.com/html/

I Inspected the source and see that it was make by hoverIntent but I can't reproduce that.
Anyone knows how to do that ?

Answer

The solution would be to use jquery :

http://jsfiddle.net/Z7ECR/41/ HTML:

<ul>
    <li class="active">EN</li>
    <li class="hidden">ES</li>
    <li class="hidden">FR</li>
    <li class="hidden">PT</li>
</ul>

CSS :

ul {
    padding:5px;
    border:1px solid #000;
    border-radius:3px;
    text-align:center;
    width:25px;
}
li {
    list-style-type:none;
}
li.hidden {
    display:none;
    border-top:1px solid #000;
}

JS :

$(document).ready(function () {
    $('ul').hover(function () {
        $('.hidden').stop(true, true).slideToggle(800);
    });
});