I've been playing with jQuery today, and I want to know if I can improve this. I noticed it is a bit slow and not as smooth too. Anyone know why?
Test - http://twomuchwork.com/playground/
My jQuery
/* View Toggle */
$(function(){
$("#hide-top").toggle(
function() {
$("#logo").fadeTo(1000,0,function(){
$("#logo").animate({'height':'0'},'fast', function(){
$("#logo").css("display", "none");
$("#content").animate({'height':'86%'},'400');
$("#hide-top").html('Show Top');
});
});
},
function() {
$("#content").animate({'height':'70%'},'400', function(){
$("#logo").animate({'height':'80px'},'fast');
$("#logo").fadeTo(1000,1);
$("#hide-top").html('Hide Top');
});
});
$("#hide-right").toggle(
function() {
$("#sidebar ul").fadeTo(1000,0,function(){
$("#content").animate({'width':'96%'},'fast');
$("#nav-bg").animate({'width':'96%'},'fast');
$("#nav-bg").animate({'width':'96%'},'fast');
$("#hide-right").html('Show Right');
});
},
function() {
$("#content").animate({'width':'77%'},'fast', function(){
$("#nav-bg").animate({'width':'76%'},'fast');
$("#sidebar ul").fadeTo(1000,1);
$("#hide-right").html('Hide Right');
});
}
);
});