新年
快乐
jQuery+html5点击展开菜单列表项动画特效

jQuery+html5点击展开菜单列表项动画特效

jQuery+html5点击展开菜单列表项动画特效插图1

jQuery+html5实现的汉堡包图标点击展开菜单列表项动画特效,再点击列表项链接切换到相应内容。

js代码

<script src="https://img.x22t.com/file/2020/04/25/e61230bf8f79d5e07af2243b7cbe61de3553.js?t=1"></script>
<script src="https://img.x22t.com/file/2020/04/25/9d4b820dc8932a87af14926c976da5911971.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
	var $demo = $(".demo");
	var menuTextAT = 500;
	$(document).on("click", ".demo__menu-btn", function () {
		$demo.addClass("menu-active");
	});
	$(document).on("click", ".demo__menu-item", function () {
		var $item = $(this);
		var targetSection = $item.data("section");
		$item.addClass("clicked");
		$demo.removeClass("menu-active");
		$(".demo__section.active-section").removeClass("active-section");
		$(".demo__section--" + targetSection).addClass("active-section");
		setTimeout(function () {
			$item.removeClass("clicked");
		}, menuTextAT);
	});
});
</script>

分享到 :
相关推荐

Leave a Reply

Your email address will not be published. Required fields are marked *