[Solved] Create a sliding div on click [closed]


Try this, will it work for you?

https://jsfiddle.net/gwxhz3pe/6/

var width;

$('#content').click(function(){
    if($(this).hasClass('open')){
        $(this).removeClass('open');
        width = "10px";
    } else {
        $(this).addClass('open');
        width = "300px";
    }
    $(this).animate({
        width: width
      }, 200, function() {
      });

});

2

solved Create a sliding div on click [closed]