Answer the question
In order to leave comments, you need to log in
How to make a slide-out menu at the top with jQuery?
Good time of the day.
Help, please, with the script of the slide-out menu at the top.
I need that when I click on the menu button, the menu itself appears and the bottom content moves down by 170px.
When you press the button again, the menu disappears and the content moves up.
I wrote a script, but when the button is pressed again, the menu disappears, the content did not move up.
<div id="icon_menu_img"><img class="icon_menu_img" src="images/picture/icon-menu2.png" alt="Меню"/></div>
<div class="icon-menu" style="display:none;">
<div id="menu_left">
<nav>
<div class="hr">
<ul class="menu_1">
<li><a href="index.php">Хостинг</a></li>
<li><a href="library/domain.php">Домен</a></li>
<li><a href="html/site.php">Сайт</a></li>
</ul>
</div>
</nav>
</div>
</div>
<div class="content">
...............
</div>
$(document).ready ( function ( ) {
$("#icon_menu_img").click(function(){
$(".content").css("padding-top","170px");
$(".icon-menu").toggle();
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question