hoverflow test

by Jayson Buquia

HTML

<ul>
    <li>This is a link</li>
   <li>This is a link</li>
    <li>This is a link</li>
    <li>This is a link</li>
    <li>This is a link</li>    
</ul>

CSS

li {
    position: relative;
    left: 0;
    background: black;
    color: white;
    display: table;
    padding: 2px 5px;
    cursor: pointer;
}

JavaScript

$("li").each(function(){
    var h = true;
    $(this).hover(function(e){        
        if ( h ) {
            $(this).animate({'left':50});
        } else {
            e.preventDefault();
        }
        h = false;
    },function(e){
        $(this).animate({'left':0},function(){
            h = true;
        });
    });
});