小编Maj*_*aju的帖子

jQuery scrollTop无法在Chrome中运行但在Firefox中工作

我已经scrollTop在jQuery中使用了一个函数来导航到顶部,但奇怪的是"平滑的动画滚动"在我做了一些更改后停止在Safari和Chrome中工作(滚动没有平滑的动画).

但它仍然在Firefox中顺利运行.可能有什么不对?

这是我使用的jQuery函数,

jQuery的:

$('a#gotop').click(function() {
    $("html").animate({ scrollTop: 0 }, "slow");
    //alert('Animation complete.');
    //return false;
});
Run Code Online (Sandbox Code Playgroud)

HTML

<a id="gotop" href="#">Go Top </a>
Run Code Online (Sandbox Code Playgroud)

CSS

#gotop {
      cursor: pointer;
      position: relative;
      float: right;
      right: 20px;
      /*top:0px;*/
}
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui jquery-selectors

78
推荐指数
4
解决办法
9万
查看次数

如何禁用谷歌翻译原始文本工具提示

我在我的网站上使用谷歌翻译作为语言转换器,但它显示了令人讨厌的工具提示,称为"原始文本".如何禁用此功能以及任何其他更好的创意/工具/ apis来执行此操作?

谢谢.使用的代码是......

<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> 
Run Code Online (Sandbox Code Playgroud)

html javascript jquery google-translate internationalization

16
推荐指数
3
解决办法
2万
查看次数