1

I tried multiple solutions from here:

jQuery click not working in iOS?

or this

How to bind 'touchstart' and 'click' events but not respond to both?

but none of them are working.


This doesn't work at all. I also tried touch start event but even with this event, it doesn't work.

Any other solutions?

$("#more").on("click", function(e) {
  console.log(e.type);
  if (biography) {
    $("#biography").attr("src", "/images/arrow_down.svg");
    $("#user-biography").slideUp(500);
    $("#biography-arrow").slideUp(499);
    biography = false;
  }
  if (!more) {
    $("#user-info").fadeOut(500);
    $("#profile-info").fadeOut(500);
    $("#more-options").delay(500).slideDown(500);
    $("#more-arrow").delay(499).slideDown(500);
    more = true;
  } else {
    $("#user-info").delay(500).fadeIn(500);
    $("#profile-info").delay(500).fadeIn(500);
    $("#more-options").slideUp(500);
    $("#more-arrow").slideUp(499);
    more = false;
  }
});

EDIT:

Solution found:

window.onload = function () {
            document.getElementById("more").onclick = function () {

}
}

Inside also jQuery functions are working.

Community
  • 1
  • 1
Fabio
  • 302
  • 2
  • 12
  • What type of element is `$("#more")` referring to? – Nope Mar 06 '17 at 16:21
  • @Fran is an img tag – Fabio Mar 06 '17 at 16:22
  • They are in an jade template. Like here: `img(src="/images/more.svg" class="more" id="more")` – Fabio Mar 06 '17 at 16:24
  • maybe this [StackOverflow - How to make my click function work with ios](http://stackoverflow.com/questions/10577906/how-to-make-my-click-function-work-with-ios) help you – Mathiasfc Mar 06 '17 at 16:24
  • This might help ► [**Image link on iPhone is not clickable**](http://stackoverflow.com/questions/10502045/image-link-on-iphone-is-not-clickable) there is 2 answers below the accepted one which might work for you. – Nope Mar 06 '17 at 16:26
  • @Fran the problem is that this isn't a image link it is an image and with jQuery it is getting clickable... This works for PC and Android but not for iOS. – Fabio Mar 06 '17 at 16:30
  • @FabioB. I don't know Jade Templates but if it basically injects the elements it could be related to this ► [**jQuery click events not working in iOS**](http://stackoverflow.com/questions/14795944/jquery-click-events-not-working-in-ios) - Someone mentions - `There is an issue with iOS not registering click/touch events bound to elements added after DOM loads` and includes a fix. – Nope Mar 06 '17 at 16:47
  • @Fran Jade Templates are rendered by Express Framework which is running on NodeJS and then displayed as HTML File to the browser. This is one element which isn't added dynamically but it isn't working either... – Fabio Mar 06 '17 at 18:45

0 Answers0