Cornerstone jQuery click not working in mobile

Hi,

I’m having an issue where no click function works in mobile when Cornerstone is activated. I’m running the latest version of X, the latest version of Cornerstone and have disabled all other plug-in’s and removed all other JS from the site. When I disable Cornerstone as well, click functions in mobile work fine. When I reactivate it, they do not. They are intermittent and appear to be bubbling as the page often shakes after interacting with the link and scrolling.

For testing purposes I’ve simply reduced the click function to an alert:

jQuery(document).ready(function($) {
$(“a.popup-form”).click(function() {
alert(“test”);
});
});

I’ll post a private topic with access to the dev site. Any help is greatly appreciated. Thank you!

Hello @snboarding,

Please try this code:

$(document).ready(function(){
    $("a.popup-form").on('click', function () {
        alert("test");
    });
});

Hope this helps.

Thanks for the code @Jade! The console is giving me this error…

TypeError: $ is not a function. (In ‘$(document)’, ‘$’ is undefined)

In my experience with X, I always need to define the $ in the function with jQuery first. Am I maybe doing something wrong with that?

Hello @snboarding,

Sorry if the given code did not work for you.

Please be advised that in smaller screens, there is no click events. You can only tap, double tap and swipe. To resolve your issue, please have your code updated and use this:

jQuery(document).ready(function($) {
  $("a.popup-form").on('click touchstart', function() {
	alert("test");
  });
});

Please let us know if this works out for you.

I ended up going a completely different route because none of this worked. Thanks for trying to help though!

If you need anything else, feel free to create another ticket.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.