我正在尝试找出是否有像fullpage.js一样的滚动页面的解决方案。一页一页地滚动网站,上下滚动。
这与fullpage.js不同,因为它将页面滑动到不同的div,但我需要它在单个div中移动。
下面是我尝试过的代码:
<div> a very long text here..... </div>
Window.onscroll = function() {test()};
Function test(){ window.scrollby(0, 300) };
上面的代码只是向下滚动,它不会停止。它会一直向下滚动,直到页面底部。
那么,怎么做呢?
我的问题很简单,但我不知道该怎么做,我在一个使用Reactjs的网站上工作,这是我的问题,我需要在点击按钮时向下滚动到特定的div,当我在同一页上时,它工作得很好,但当我在不同的页面上时,它只能导航(因为按钮在导航栏中,所以它出现在所有页面中)。 我使用的是react-scroll的链接,代码如下: import { Link as Scrolllink, animateScroll as scroll } from 'react-scroll'
<li className="has-children" >
上下文:使用JavaScript和AMD模块(如require.js)编写的单页web应用程序
用AMD模块实现i18n的更好的方法是什么?
让我们说:
translation.js返回一些i18n函数
require([..modules files., 'translation.js' ], function(.modules.. , t ){
here in the code/view templates I use t('give_me_text') function
})
这样的方法可以吗?
我有一个宽度超过100%的页面(2000 is )。当我点击显示对话框从按钮在页面的末尾(按水平页),窗口滚动到页的开头(按水平页)并显示该对话框。
这是我的代码:
$mdDialog.show(
$mdDialog.alert()
.parent(angular.element(document.querySelector('#popupContainer')))
.clickOutsideToClose(true)
.title('This is an alert title')