How to force to work a script?

There is a form that appears on click.
There is a script that collapses.
jQuery(window).on('click', function() {
 if (jQuery('.mobile-menu-container').hasClass('open')) {
 jQuery('.mobile-menu-container form.search-form').animate(
 { width: '0' },
400,
 function() {
jQuery('.mobile-menu-container').removeClass('open');
}
);
}
});

the script works fine on desktops and not working on mobile. thus, this part of the script is executed on the mobile
jQuery('.mobile-menu-container').removeClass('open');
March 12th 20 at 08:02
1 answer
March 12th 20 at 08:04
Solution
what exactly doesn't work? animate doesn't work?
Yes. animate does not work on mobile. desktops approx. - Isidro_Schaden commented on March 12th 20 at 08:07
there is likely have to watch what conduct forms prescribed under adaptiv in the css styles, as animate should work on mobile. - Luigi_Ankunding commented on March 12th 20 at 08:10
clear. direction where to dig understood. thank you - Isidro_Schaden commented on March 12th 20 at 08:13
@Isidro_Schadenyou enable the emulation of mobile telephones in the console and see something going on with form.search-form in the source code. The idea of the tag this class should subscribe style="width:0px;" and there will be clearer what is wrong - Luigi_Ankunding commented on March 12th 20 at 08:16

Find more questions by tags jQuery