I
I
Igor Lavrov2016-12-25 16:03:02
css
Igor Lavrov, 2016-12-25 16:03:02

How to make animation when text is hidden on button click?

In general, the essence is this ... there is a menu, but I would like it to appear when you click on the button and also disappear when you click it. how to do it.

The idea is that the text would fly under the logo and also appear from under it, i.e. the lines of the horizontal menu flew to the right (the menu appears), fly away to the left (the menu is hidden).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Antonov, 2017-02-24
@Maky_e0

$(".класс кнопки").click(function(){
    $(".класс меню").toggleClass("visible");
})

.класс меню{
   overflow:hidden;
   width:0; 
   transition:all 0.2s ease;
}
.класс меню.visible{
   width:700px; //например   
}

example here
You can not change the width, but the position left / right, it all depends on your layout)

N
Nikola24, 2016-12-25
@Nikola24

It is possible through jquery, with the help of toggleClass, to assign a class .visible {
//values ​​that you need
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question