Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
Using jQuery .click works but .touchstart desn't

I have a block of working code that allows me to shift from one set of colored items to another based on a span click event that runs in jQuery. I am using wordpress and it requires I spell out jQuery instead of using '$'. In part, it works by moving a variable to the active selection and changing a variety of other properties based on defined variables in the html of that 'span'

I tried changing .click(function f()... to .touchstart(function f()... and it doesn't work when I load the site on mobile. If you think you know the answer, cool. I will now list things I have tried.

This is what my click function looks like:

jQuery(document).ready(function f($) {
jQuery('.changecolor span').click(function f($) {...
});
});

Attempts:

jQuery('.changecolor span').touchstart(function e()
jQuery('.changecolor span').on("tap", function e() {...

My cache is set to auto clear every time I save a new change in, and I've tested this.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

$('.changecolor span').on('touchstart',function(ev) {
    $('your seletor').trigger(ev);
}); 
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!