WordPress theme: jQuery doesn’t work on mobile

I am working on my first wordpress theme and so far it is good.
I’ve included all needed files and everything works fine..
I have wp_head() in header and wp_footer() in the footer.

I’ve included my js file like this:

   function wpmu_load_scripts() {

       wp_enqueue_script( 'script', get_template_directory_uri() . 
          array( 'jquery' ) );

   add_action( 'wp_enqueue_scripts', 'wpmu_load_scripts' );

In the .js file, i have a slider function and event function for resposive navigation.
Everithing is fine when i resize the browser (chrome and firefox) – slider works fine and click event works also (yes, i have touchstart event also)…

BUT mobile gives me nothing. Slider and event don’t work.

When i write the same code in my header, it looks like i’ve duplicaded it and when i click on mnobile on the menu, it opens and closes. If there is noting in the header, works nothing..

hope you understood me. 😀

Read more here: WordPress theme: jQuery doesn’t work on mobile

Leave a Reply

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