Facebook评论插件显示iPad上的移动宽度 [英] Facebook Comments Plugin Displays Mobile Width on iPad

查看:134
本文介绍了Facebook评论插件显示iPad上的移动宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说。如果你有一个iPad,这是URL - 如何删除iPad的评论插件的响应宽度? (页面底部) http://dev.assessmentday.co.uk/aptitudetests_numerical.htm

解决方案

我也碰到了这个。我已经解决了它,手动添加数据移动属性设置为 false 如果我检测到这是在iPad:

 < script> 
if(navigator.userAgent.match(/ \biPad\b /)){
document.querySelector('div.fb-comments')
.setAttribute('data-mobile ','假');
}
< / script>

这可以改进来处理其他平板电脑,但最好的方法取决于Facebook自动检测移动,我不知道。也许基于显示宽度,也许是基于触摸事件处理程序的存在,或者也许是由服务器端的用户代理。


As the title says. Here is the URL if you have an iPad - How can I remove the responsive width of the Comments Plugin for iPads? (bottom of page) http://dev.assessmentday.co.uk/aptitudetests_numerical.htm

解决方案

I ran into this too. I've worked around it by manually adding the data-mobile attribute set to false if I detect this is on an iPad:

<script>
    if (navigator.userAgent.match(/\biPad\b/)) {
        document.querySelector('div.fb-comments')
            .setAttribute('data-mobile', 'false');
    }
</script>

This could be improved to handle other tablets as well, but the best way to do that depends on how Facebook auto-detects "mobile", which I'm not sure of. Perhaps based on display width, perhaps based on the presence of touch event handlers, or perhaps indeed by user-agent on the server-side.

这篇关于Facebook评论插件显示iPad上的移动宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆