0

i created a double click event on a div , when i click twice a heart react appears on top of the image , on the web browser vue it works fine but when i pressed F12 and switched to mobile view it didn't work

here is my javascript function :

$(document).on("dblclick", '#tesst', function (e) {
  var heart = $(this).find("i");
  heart.fadeIn("slow");
  setTimeout(function () {
    heart.fadeOut("slow");
  }, 2000);
  heartReact();
});

here is my div :

stringMsg =
    '<div class="/col-lg-4 delcd-tours animate-box/">' +
    '<div id="tesst" class="hot-img-container" >' +
    '<a href="#">' +
    '<div  class="instagram">' +
    '<i id="heart" class="fa fa-heart">' + '</i>' +
    '<img  src="" id="myImgTag' + element.id_publication + '" class="img-fluid" alt="" />' +
    '</div>' +
    "</a>" +
    '<div class="desc">' +
    "<span>" +
    "</span>" +
    "<h3>" +
    element.pays +
    "</h3>" +
    "<span>" +
    "</span>" +
    '<span class="price">' +
    element.budget +
    "</span>" +
    '<a class="btn btn-primary btn-outline" href="tour-detail.html">' +
    "View Trip" +
    '<i class="icon-arrow-right22">' +
    "</i>" +
    "</a>" +
    "</div>" +
    "</div>" +
    "</div>";


  document.getElementById("pubslist").innerHTML += stringMsg;
  document.getElementById("myImgTag" + element.id_publication).src = element.imagePub;

is there any solution for this problem to make it work on both web and mobile view

AOUADI Slim
  • 299
  • 1
  • 8
  • 27
  • It's not possible. You cant click on a mobile, you tap. There are workarounds tho. – Kevin.a Nov 19 '19 at 14:57
  • 1
    Possible duplicate of [jQuery on 'double click' event (dblclick for mobile)](https://stackoverflow.com/questions/27560653/jquery-on-double-click-event-dblclick-for-mobile) – Kevin.a Nov 19 '19 at 14:58

0 Answers0