Facebook评论插件显示iPad上的移动宽度 [英] Facebook Comments Plugin Displays Mobile Width on iPad
问题描述
我也碰到了这个。我已经解决了它,手动添加数据移动
属性设置为 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屋!