jQuery variable & attr()
<p>how can i use element id and attr() ?
why this code doesn't work ?</p>

<pre><code>$(document).ready(function(){
$('#navbar li a').click(function() {
    var classname = $('#content .' + $(this).attr('class'));
    if (!classname.hasClass('current-c')) {
        $('.current-c').animate({opacity:'0', top:'-20'}, 150 , function(){
            $(this).css('display','none').removeClass('current-c');;
            classname.css('display','block').animate({opacity:'1', top: '0'},220, function() {$(this).addClass('current-c')});
        });
    }
}); }); 
</code></pre>
