4.1安卓html样式,Android 4.1默认浏览器以奇怪的方式呈现HTML页面(Android 4.1 default browser renders HTML page in a strang...

Android 4.1默认浏览器以奇怪的方式呈现HTML页面(Android 4.1 default browser renders HTML page in a strange way)

我们得到了一个登录表单,由Rails轻轻制作。 但是当我们从Galaxy S3访问该网站并且第一次访问该网站时(或者缓存很清楚),该页面无法完全呈现。 相反,页面的底部正在被剪切。

然而,如果我专注于输入元素之一(或者我至少点击它应该在的位置),页面呈现正确。

以下是首次输入页面时的外观示例及其外观:

EjDW7.png

HNqAd.png

所以,问题是:我可以用javascript强制页面重绘或者我的页面有问题吗?

We got a login form, gently produced by Rails. But when we access the website from Galaxy S3 and it is accessed first time (or caches are clear), the page does not render fully. Instead, the bottom part of the page is being cut.

Yet, if i focus on one of input elements (or i tap the place where it should be, at least), page renders correctly.

Here are the examples on how the page looks when first entered and how it should look like:

EjDW7.png

HNqAd.png

So, the question is: can i force page redraw with javascript or there's something wrong with my page?

原文:https://stackoverflow.com/questions/16235977

更新时间:2020-07-15 22:07

最满意答案

修复了替换表单容器的HTML而不是显示/隐藏具有不同表单的块。

例如,我们有两个登录和注册表格块。 在登录按钮上单击“登录”块显示,并且“注册”块被隐藏。 反对。 所以我只是用HTML替换替换了show / hide方法:

$('.form-container').html($('.sign-in-form').html())

要么

$('.form-container').html($('.sign-up-form').html())

Fixed replacing the form container' HTML instead of showing/hiding blocks with different forms.

E. g., we had two blocks for login and sign up forms. And on sign in button click "sign in" block showed and "sign up" block was hidden. And over against. So i just replaced the show / hide methods with HTML replacement:

$('.form-container').html($('.sign-in-form').html())

or

$('.form-container').html($('.sign-up-form').html())

相关问答

是的,我们可以将此代码用于我们的应用程序中的呼叫浏览器设置页面 Intent i = new Intent(Intent.ACTION_MANAGE_NETWORK_USAGE);

// It launches Chooser without specify the package name becz ACTION_MANAGE_NETWORK_USUAGE // action is used in Other apps also.

i.setPackage("com.android.bro

...

删除溢出属性并将位置更改为body元素的相对位置对我有用。 它应该如下所示: body {

position: relative;

top: 0;

left: 0;

right: 0;

bottom: 0;

}

编辑:错误的复制/粘贴 编辑2:更新的答案 Removing the overflow properties and changing the position to relative for the body element worked f

...

您应该能够在您的网页上添加一些javascript,以便在您的网页浏览获取内容时扩展内容。 下面是一个示例,它将缩放您的html内容,以便内容适合屏幕的可用宽度: function customScaleThisScreen()

var contentWidth = document.body.scrollWidth,

windowWidth = window.innerWidth,

newScale = windowWidth / contentWi

...

如果你想让面板2位于面板3的顶部,那么你需要应用像z-index:-1;这样的东西z-index:-1; 。 我修改了你的小提琴,以显示这个工作。 按照您的要求,面板3位于面板2的后面,并且有一个按钮,单击该按钮可将面板向右移动。 您可以轻松地将其整理到隐藏整个面板并执行一些很酷的jQuery内容,以使幻灯片转换更好。 试着记住,除非你另有说法,否则孩子通常会出现在他们的父母面前。 If you want panel 2 to be on top of panel 3 then you will

...

不能。通过WebView打开默认浏览器需要在本机App上实现。 特别是App开发人员应该重写方法WebViewClient.shouldOverrideUrlLoading并启动一个意图,以通过WebView在单独的浏览器中加载URL。 No. Opening default browser by WebView requires an implementation on native App. In particular the App developer should override the

...

我知道了 在Joomla默认情况下加载jQuery。 在Joomla 3.6.2(我正在使用)中,它默认加载jQuery v1.12.4 ,它存储在这个目录中: /media/jui/js/jquery.min.js 我只是尝试用最新版本替换它,它解决问题,但它创建另一个! 在控制台日志中,我收到一条消息,因为引导程序我无法使用jQuery V3。 然后我降级到jQuery v2.2.4 (版本3之前的最新版本)和Hoooraaaaaaaaa,现在它的工作没有任何问题。 希望它能帮助别人 谢谢 I

...

作为记录: 似乎我在不正确地进行身份验证。 我使用的是http :: @ sub.domain.com。 没有失败,但是一旦我切换到WebViewClient onReceivedHttpAuthRequest,一切都开始正常工作。 离奇。 For the record: Seems I was authenticating improperly. I was using a http::@sub.domain.com. Didn't fail, but once I switched to We

...

修复了替换表单容器的HTML而不是显示/隐藏具有不同表单的块。 例如,我们有两个登录和注册表格块。 在登录按钮上单击“登录”块显示,并且“注册”块被隐藏。 反对。 所以我只是用HTML替换替换了show / hide方法: $('.form-container').html($('.sign-in-form').html())

要么 $('.form-container').html($('.sign-up-form').html())

Fixed replacing the form con

...

将此添加到头部

add this to head

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值