JQuery Button click not working along with overflow-y on Android 4.2.2

157 views Asked by At

We are using a jQuery Mobile popup in a Cordova app. The button click event is not firing when we enable scrolling (using overflow-y). This issue is happening only on Android 4.2.2, whereas it seems to be working fine on other versions. We have tried multiple options but could not fix this!

<div data-role="popup" id="main" style:'height: 60%;'> 
    <div id="header"></div> 
    <div id="content" style='height: 90%; overflow-y: scroll'></div> 
</div> 
$(document).ready(function(){ 
    var data = ""; 
    data += "" ;

    //some images 
    data += "<div id='main_buttons'><div style='margin-left:10%;margin-right:10%;font-size:40px'>some text here</div>"; 
    data += "<table style='margin-left:10%;' width='82%'><tr width='82%'><td align='right'><button type='submit' id='btn1' >Adjust button</button></td>"; 
    data += "</tr></table></div>";     

    document.getElementById('content').innerHTML = data;

    //click event 
    $(document).on("click", "#btn1", function(e){ 
        alert("button clicked"); 
    }); 
});
0

There are 0 answers