Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/122.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Bootstrap Popover单击关闭:在桌面浏览器中工作正常,但在移动浏览器中不工作_Javascript_Ios_Twitter Bootstrap_Popover - Fatal编程技术网

Javascript Bootstrap Popover单击关闭:在桌面浏览器中工作正常,但在移动浏览器中不工作

Javascript Bootstrap Popover单击关闭:在桌面浏览器中工作正常,但在移动浏览器中不工作,javascript,ios,twitter-bootstrap,popover,Javascript,Ios,Twitter Bootstrap,Popover,因此,我有一个在NodeJ上运行的web应用程序,它的前端使用引导。我集成了一些引导弹出窗口,它们执行以下操作: 当用户单击或轻触图像时,它将弹出弹出窗口 用户可以单击任意位置,它将关闭popover 当我从台式机或笔记本电脑浏览器打开应用程序时,它们工作正常,但当我在移动浏览器(iPhone上的safari)上打开应用程序(使用计算机的IP地址)时,弹出窗口不会在单击时关闭。这里有什么问题?我遗漏了什么吗?代码如下: <img src='/images/question.png' tab

因此,我有一个在NodeJ上运行的web应用程序,它的前端使用引导。我集成了一些引导弹出窗口,它们执行以下操作:

  • 当用户单击或轻触图像时,它将弹出弹出窗口
  • 用户可以单击任意位置,它将关闭popover 当我从台式机或笔记本电脑浏览器打开应用程序时,它们工作正常,但当我在移动浏览器(iPhone上的safari)上打开应用程序(使用计算机的IP地址)时,弹出窗口不会在单击时关闭。这里有什么问题?我遗漏了什么吗?代码如下:

    <img src='/images/question.png' tabindex="0" role="button" data-trigger="focus" height="10" width="10" data-toggle="popover" title="Daily Hub Activity" data-content="Lorem ipsum blablabla." animation="true" data-placement="bottom">
    

    我相信iOS不会将点击事件绑定到
    html
    body
    。尝试一下类似的方法():


    希望这能有所帮助。

    嘿,它不起作用,但还是感谢您的参考!更近一步。这里有类似的问题:
    $('[data-toggle="popover"]').popover();
    
    $('body').on('click', function (e) {
        $('[data-toggle="popover"]').each(function () {
            //the 'is' for buttons that trigger popups
            //the 'has' for icons within a button that triggers a popup
            if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
                $(this).popover('hide');
            }
        });
    });