【问题标题】:Change height of a div in opera mobile在opera mobile中更改div的高度
【发布时间】:2012-09-15 15:56:03
【问题描述】:

我在 Opera mobile 上更改 div 的高度时遇到问题,在其他浏览器上它可以正常工作。

我正在使用一个计划和简单的$('div').height(newheight),但它没有改变,我相信这是一个错误,但必须有一个解决方法,因为 Jquery Mobile 正在调整整个页面的大小。

你知道这是什么解决方法吗?

谢谢

【问题讨论】:

    标签: jquery-mobile opera


    【解决方案1】:

    我建立的所有网站都遇到了类似的问题,并且确实认为这是移动浏览器中的错误。我发现修复它的唯一方法实际上是在 SMS 插件标记中使用宽度/高度,但不幸的是它会弄乱它在其他浏览器上的显示方式。

    我找到了两个解决方案:选项一是等待,因为 Opera 正在切换到 web-kit,选项二是插入一个简单的警报 jQuery 脚本,该脚本检测用户是否正在使用 Opera 浏览并通知他们改为使用支持的浏览器(即 Firefox、Safari)。它将与我用于 IE 9 以下的任何代码块相同:

     if ( $.browser.msie ){
    if($.browser.version == '6.0')
    {   
      // page redirect and alert for upgrade
      alert("... REQUIRES YOU TO UPGRADE YOUR WEB BROWSER For enhanced security and features on this website, please download Internet Explorer 9");
    }
    else if($.browser.version == '7.0')
    {    
      // page redirect and alert for upgrade
      alert(".... REQUIRES YOU TO UPGRADE YOUR WEB BROWSER For enhanced security and features on this website, please download Internet Explorer 9");
    }
    else if($.browser.version == '8.0')
    {   
      // page redirect and alert for upgrade
      alert("... REQUIRES YOU TO UPGRADE YOUR WEB BROWSER For enhanced security and features on this website, please download Internet Explorer 9");
    }
    

    } });

    抱歉,我没有您需要的确切代码匹配,我只是还没来得及做,但您需要将 browser.msie 替换为无论 m.O 的标记是什么

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-17
      • 1970-01-01
      • 1970-01-01
      • 2013-05-24
      • 2014-11-29
      • 1970-01-01
      • 2019-02-10
      • 2012-09-25
      相关资源
      最近更新 更多