S
S
Sinner32019-01-21 22:12:26
JavaScript
Sinner3, 2019-01-21 22:12:26

Why doesn't dblclick work in jquery on iphone?

I use jquery 3.3.1 and I want to open the menu with a single click and follow the link with a double click, it works on android but not on iphone. I can't understand what is the problem, please help
javascript code like this

$(document).on('dblclick', '.DoubleClick', function() {"use strict";
      window.location.assign($(this).attr('href'))			
});
$(document).on('click', '.DoubleClick', function(event) {"use strict";
      event.preventDefault()
  			$(this).siblings('ul').slideToggle();
      
});

menu structure is something like this
<li class="two_item main-inner-menu__item item-parent"> 
<a href="" class="main-inner-menu__link DoubleClick">Текст ссылки</a> <span class="expandables menu-icon-close"></span>
  <ul class="main-inner-menu main-inner-menu_sub main-inner-menu_2">
    <li class="main-inner-menu__item"> <a href="" class="main-inner-menu__link closed-2 ">Текст ссылки</a> </li>
    <li class="main-inner-menu__item"> <a href="" class="main-inner-menu__link closed-2 ">Текст ссылки</a> </li>
    <li class="main-inner-menu__item"> <a href="" class="main-inner-menu__link closed-2 ">Текст ссылки</a> </li>
    <li class="main-inner-menu__item"> <a href="" class="main-inner-menu__link closed-2 ">Текст ссылки</a> </li>
    <li class="main-inner-menu__item"> <a href="" class="main-inner-menu__link closed-2 ">Текст ссылки</a> </li>
  </ul>
</li>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zemlyanoy, 2019-01-22
@Galamoon

Here is a solution to the same problem on stackoverflow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question