Here's my piece of code
$j('#hideShowBtn').toggle(function() {
$j('.playlist-bar-tray').slideUp();
$j(this).attr("title","Show Playlist");
$j(this).children("div").html('Show Playlist');
$j(this).children("span").html('▼');
}, function() {
$j('.playlist-bar-tray').slideDown();
$j(this).attr("title","Hide Playlist");
$j(this).children("div").html('Hide Playlist');
$j(this).children("span").html('▲');
});
Is there a better way of writting this ? I feel like there's a lot of lines for such a small thing.
Can it be optimized?
Thanks!