$(function() {
$('.clickme').click( function() {
var toggled = $(this).data('toggled')||1
switch ( toggled ) {
case 1:
$("#slideout").animate({left:'0px'}, {queue: false, duration: 500});
break;
case 2:
$("#slideout").animate({left:'-280px'}, {queue: false, duration: 500});
break;
}
toggled++;
if (toggled > 2) toggled = 1
$(this).data('toggled',toggled);
});
});
$(function () {
$('.clickme').on('click', function() {
$('#slideout').toggleClass('slideout-toggle');
});
});
#slideout.slideout-toggle {
left: 0px;
}
transition: all 0.5s;
-webkit-transition: all 0.5s;