S
S
speculant2018-11-15 18:44:39
JavaScript
speculant, 2018-11-15 18:44:39

After some time, when you click on the button, the window does not appear the first time, what could it be?

When you press the button, a window appears in which images are displayed, but sometimes it does not appear the first time, darkening occurs and is immediately canceled, and usually this happens after a while. What could it be?

$('#overlay').fadeIn(0, 
     function(){ 
          $('.ant-modal-content') 
          .css('display', 'block') 
          .animate({opacity: 1, top: '15%'}, 200); 
            //тут вывод изображений
       }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Chefranov, 2018-11-15
@Chefranov

try to specify 300 instead of zero, maybe too fast

$("#overlay").fadeIn(300, function() {
  $(".ant-modal-content").css("display", "block").animate({ opacity: 1, top: "15%" }, 200);
  //тут вывод изображений
});

And this code should be inside document ready

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question