【发布时间】:2011-08-25 11:55:59
【问题描述】:
我有一个 rtl 格式的 HTML 页面,其中包含以下代码,而 Google 加一按钮在页面中显示效果不佳。 在加载 plusone.js 文件之前,由于 html 标记中的 dir="rtl" 存在一个非常大的水平滚动。 加载 plusone.js 后,滚动将消失。 我怎样才能避免出现和消失这个水平滚动。(我不想从标签中删除 dir="rtl")
<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl">
<head>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</head>
<body>
<div id="content">
<div class="g-plusone" data-size="small" data-annotation="none"></div>
</div>
</body>
</html>
【问题讨论】:
标签: html google-plus-one right-to-left