Bootstrap Modal button not working, only on iOS

一笑奈何 提交于 2019-12-01 11:09:05

I just discovered the answer. It seems that iOS needs an additional class which lets safari know that the button is clickable. I added the additional class to the button and everything seems to be working.

.clickable {
cursor: pointer;}
Andrew1996

The modal may not show on safari but on other browsers when the href="#" is missing.

Try this and see if this works:

<a data-toggle="modal" href="#myModal class="tutorial__btn btn-green1 role-element leadstyle-link">Click Here To Sign Up</a>

Okay now try this bit of PHP:

Change

!--Button-->
<a data-toggle="modal" data-target="#myModal" class="tutorial__btn btn-green1 role-element leadstyle-link">Click Here To Sign Up</a>

to

!--Button-->
<?php 

$iPod    = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone  = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad    = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");

if( !$iPod || !$iPhone || !$iPad){ 
    echo "<a data-toggle='modal' data-target='#myModal' class='tutorial__btn btn-green1 role-element leadstyle-link'>Click Here To Sign Up</a>"
} else{
    echo "<a data-toggle='modal' a href='#myModal' class='tutorial__btn btn-green1 role-element leadstyle-link'>Click Here To Sign Up</a>"
}

?>

What this should do is detect if it's an iOS device and if it is display the modal that works in iOS and if it isn't display the other one. Try that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!