October 22, 2024
Chicago 12, Melborne City, USA
jQuery

jQuery $('CLASS').on('click tap touchstart', function(event) not working on mobile


EDITED AND REPOSTED

as the title says, the function is working properly on desktop, but not on mobile. The code is below, but I’ve removed most of it because it’s quite repetitive and long, but if you need the entire script I’m happy to provide it.

Thanks!

HTML

<span id="brxe-wlyncw" class="brxe-button main-cta-button pricing-btn faq-btn bricks-button bricks-background-primary">Pricing</span>

<div id="brxe-bilrmd" class="brxe-container pricing-faq"></div>
<div id="brxe-bilrmd" class="brxe-container plans-faq"></div>
<div id="brxe-bilrmd" class="brxe-container seo-faq"></div>
<div id="brxe-bilrmd" class="brxe-container websites-faq"></div>

jQuery

jQuery(document).ready(function($){

$('.faq-btn').on('click tap touchstart', function(event) {
    event.preventDefault();
    if($(this).hasClass('pricing-btn')){

    $('.pricing-faq').show();
    $('.plans-faq').hide();
    $('.seo-faq').hide();
    $('.websites-faq').hide();

} else if ($(this).hasClass('plans-btn')){

    $('.pricing-faq').hide();
    $('.plans-faq').show();
    $('.seo-faq').hide();
    $('.websites-faq').hide();

} else if ($(this).hasClass('seo-btn')){

    $('.pricing-faq').hide();
    $('.plans-faq').hide();
    $('.seo-faq').show();
    $('.websites-faq').hide();

} else if ($(this).hasClass('websites-btn')){

    $('.pricing-faq').hide();
    $('.plans-faq').hide();
    $('.seo-faq').hide();
    $('.websites-faq').show();
}
});

});



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video