1
1
1sviat12021-06-28 01:16:46
WordPress
1sviat1, 2021-06-28 01:16:46

What to do if the link opens on the second click on a mobile phone?

In general, I had the following problem. On the mobile version of the site, when you click on a category link or on a product link, it will only go if you click twice. If anyone knows how to solve this problem, please tell me. Thank you in advance for your help!
Website: http://testsiteforbudsegment.pp.ua/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2021-06-28
@1sviat1

Good afternoon.
I'm guessing it has to do with the following:
You have a div block with a class: cms-banner-inner
event from the doubletaptogo.js js file has been added to it (double click to continue)
cyDYFai.png
Here is a link to the file that does this:

http://testsiteforbudsegment.pp.ua/wp-content/themes/toolsjet/js/codezeel/doubletaptogo.js

Most likely this script, provided that the entry was made from the mob. device, catches a click on the element, then makes event.preventDefaultand waits for a double click on the element.
In general, look in the theme settings, most likely there is a function somewhere to disable this
/*
  By Osvaldas Valutis, www.osvaldas.info
  Available for use under the MIT License
*/



;(function( $, window, document, undefined )
{
  $.fn.doubleTapToGo = function( params )
  {
    if( !( 'ontouchstart' in window ) &&
      !navigator.msMaxTouchPoints &&
      !navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false;

    this.each( function()
    {
      var curItem = false;

      $( this ).on( 'click', function( e )
      {
        var item = $( this );
        if( item[ 0 ] != curItem[ 0 ] )
        {
          e.preventDefault();
          curItem = item;
        }
      });

      $( document ).on( 'click touchstart MSPointerDown', function( e )
      {
        var resetItem = true,
          parents	  = $( e.target ).parents();

        for( var i = 0; i < parents.length; i++ )
          if( parents[ i ] == curItem[ 0 ] )
            resetItem = false;

        if( resetItem )
          curItem = false;
      });
    });
    return this;
  };
})( jQuery, window, document );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question