Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

function not working on modal in web browser

i have problem my function not working in mobile browser but when i open in browser desktop work i dont know why... maybe anybody know or have experience like me i have try this code

$('body').on('click touchstart', '.show_range', function(event) { alert("hello"); })

work in desktop but not in mobile browser

i have try this code when i set id in my link

$(document).on("click", "#show_range", function(event){
 alert( "GO" ); 
 });

work in desktop but not in mobile browser

like image 936
Jefri Fernando Avatar asked Feb 21 '26 16:02

Jefri Fernando


1 Answers

if you are using bootstrap modal then make some change as below,

in bootstrap-responsive.css

.modal { 
    position: fixed; 
    top: 3%; 
    right: 3%; 
    left: 3%; 
    width: auto; 
    margin: 0; 
}
.modal-body { 
    height: 60%; 
}

and in bootstrap.css

.modal-body { 
    max-height: 350px; 
    padding: 15px; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
 }

OR try this,

if( navigator.userAgent.match(/iPhone|iPad|iPod/i) ) {
    var styleEl = document.createElement('style'), styleSheet;
    document.head.appendChild(styleEl);
    styleSheet = styleEl.sheet;
    styleSheet.insertRule(".modal { position:absolute; bottom:auto; }", 0);
 }
like image 76
Soni Vimalkumar Avatar answered Feb 23 '26 06:02

Soni Vimalkumar