Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap jQuery event.target Not working

I have PhoneGap-iOS Application for iPad where User will get Logout Popup as shown in Image below.

Logout popup

I want this popup to hide when User clicks on Body. My code which works on native browser is not working on iPad Simulator.

$("body").ClickOrTouch(function (evt) {
    if (!(evt.target.id == "launchUsername") {
        $('#launchLogout').hide();
    }
});
like image 492
Prasen Avatar asked May 15 '13 07:05

Prasen


1 Answers

In iPhone, iPad devices click event will work in anchor tag only not for span or div tags, so try this it will work.

$("body").on('click touchend', function (evt) {
  if (!(evt.target.id == "launchUsername") {
    $('#launchLogout').hide();
  }
});
like image 98
Kathiravan Avatar answered Sep 19 '22 23:09

Kathiravan