There is such a plugin called TypeIt. I want to make a menu on the site, with the effect of the printed text. That is, there is no menu initially (there is only a button), you click on the "print" menu button, then I press the button a second time and the menu magically disappears. By trial and error, I realized that the option of changing the class and the display: inline/none property as a menu hide / display does not work: the plug-in simply does not update and when you try to call the menu a second time, only a blinking cursor appears. Then I decided to completely remove and add menus to the site using the append method, and then launch the plugin. But nothing works. Help link these two scripts together.
<script src="https://cdn.jsdelivr.net/jquery.typeit/4.4.0/typeit.min.js"></script> <button class="menu_btn"></button> <div class="menu-content" id="menu-content"></div> $(document).ready(function() { var menuBtn = $('.menu_btn'); menuBtn.click(function(event) { if (event.target.classList.contains('menu_btn_active')) { $(".effects").fadeOut(); setTimeout(function () { $(".effects").remove(); }, ); } else { $(".menu-content").append("<div class='effects' style='display: none;'>Эффект</div>"); $(".effects").fadeIn(); } menuBtn.toggleClass('menu_btn_active'); return false; }); }); $(document).ready(function() { menuBtn.click(function(event) { new TypeIt('.effects', { }); }); });
reset()method - Egor Zholnin