FireBug启用时,matchMedia返回null [英] matchMedia returns null when the FireBug is enabled

查看:145
本文介绍了FireBug启用时,matchMedia返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的web应用程序使用 matchMedia 。有时候调用这个函数会返回 null ,无论传递什么值。这很奇怪,但并不总是(可能是3次中的1次),只有在FireFox中打开FireBug。有没有人遇到这样的问题?

解决方案

似乎matchMedia()在FF中调用隐藏(显示:无)iframe。
当我使用jQuery UI的标签小部件时,我遇到过这种情况,标签面板是iframe。我的解决方法是重写jQuery UI的.ui-tabs-hide CSS class:

  .ui-tabs-hide {display:块!重要的;位置:绝对;左:-99999px; } 


My web application uses matchMedia. Sometimes call of this function returns null no matter what value is passed. It is strange but it happens not always (maybe 1 of 3 times) and only in FireFox with opened FireBug. Did anybody face with such issue ?

解决方案

It seems that matchMedia() returns null in FF when it's called in a hidden (display: none) iframe. I've encountered this behavior when I've used jQuery UI's tabs widget, and the tab panels were iframes. My workaround was to override the jQuery UI's .ui-tabs-hide CSS class:

.ui-tabs-hide { display: block !important; position: absolute; left: -99999px; }

这篇关于FireBug启用时,matchMedia返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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