T
T
tim_tairan2015-05-21 16:37:21
JavaScript
tim_tairan, 2015-05-21 16:37:21

Appearance and disappearance of element lists in js?

Guys please help me with the code.
There is such a script

$(document).ready(function(){				
  $('.menu-icon').click(function(){	
    $('.menuTrigger').toggleClass('menuToggle');
    $('.overlay-box').toggleClass('open');
    $(function() {
        $('.menu ul li').each(function(i) {
        $(this).delay((i++) * 200).fadeTo(1000, 1); })
    });
    
  });
});

He performs the animation of the menu icon + the appearance and disappearance of the menu + the appearance and disappearance of the menu list in turn. But it works only 1 time after refreshing the page, I'm talking about "the appearance of the menu list in turn", but you need it to work all the time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GreatRash, 2015-05-21
@GreatRash

Why did you wrap it in a function here, you know?

$(function() {
  $('.menu ul li').each(function(i) {
  $(this).delay((i++) * 200).fadeTo(1000, 1); })
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question