在窗口大小调整之前,Chrome会在RTL语言网站上显示空白页面 [英] Chrome shows blank page on RTL language site until window is resized

查看:149
本文介绍了在窗口大小调整之前,Chrome会在RTL语言网站上显示空白页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚创建了一个阿拉伯语版本的网站,并注意到Chrome有时会显示一个完全空白的页面,直到窗口被调整大小,然后所有内容立即变得可见。

一个RTL语言,所以< html> 标签的 dir =rtllang =ar它。这是它与英文网站唯一的区别。

这是网站。您可能需要多次点击徽标才能看到空白。

解决方案

我也注意到了这个问题,我用英文和阿拉伯文搜索了互联网,但找不到问题。我发现了一个解决方法来解决它;在您的rtl指导的网页中使用以下jQuery脚本:

  // Chrome RTL用户界面问题修正
$(文档).ready(function(){
$(window).load(function(){
$(body).animate({
scrollTop:1
}) ;
});
});

它只是通过 1px 在所有页面元素被加载后。如果您愿意,可以添加一个滚动回滚的代码。


I just created an Arabic version a website and noticed that Chrome sometimes shows a totally blank page until the window is resized and then everything instantly becomes visible.

Arabic is a RTL language, so the <html> tag has dir="rtl" lang="ar" added to it. This is the only difference between it and the English site.

This is the site. You may have to click the logo a few times in order to see it show blank.

解决方案

I've noticed this problem too and I searched the internet in English and Arabic but couldn't find the cause of the problem. I found a workaround to fix it though; use the following jQuery script in your rtl-directed webpages:

//Chrome RTL UI Issue Fix
$(document).ready(function(){
    $(window).load(function() {
        $( "body" ).animate({
            scrollTop: 1
        });
    });
});

All it does is that it scrolls the page by only 1px right after all the page elements have been loaded. You can add a code that scrolls it back if you want.

这篇关于在窗口大小调整之前,Chrome会在RTL语言网站上显示空白页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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