This is error patch:
And here is my code for hide modal in iphone device
$(document).ready(function(){
var modal = $('.myModal', window.top.document); // Works
modal.on('show.bs.modal', function(e) {
var width = $(window).width();
var testdevice = /iPhone/i.test(navigator.userAgent);
if(testdevice) {
$(this).modal('toggle');
}
});
});