0
我正在尝试在Angular2项目中使用fullpage.js。所以,我的index.html里面,我有以下:与Angular2一起使用Fullpage.js
<html>
<head>
....
<link rel="stylesheet" type="text/css" href="styles/jquery.fullPage.css" />
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/jquery.fullPage.min.js"></script>
<script type="text/javascript" src="js/jquery.fullPage.js"></script>
<script>
$(document).ready(function() {
$('#fullpage').fullpage();
});
</script>
</head>
<body>
<div class="container" id="fullpage">
<app-root>Loading...</app-root>
</div>
</body>
</html>
由于这是Angular2项目,我已经排到了几页,每页包含部分的极少数。例如,在home.html的:
<section id="home_section1" class="section">
some text
</section>
<section id="home_section2" class="section">
some text
</section>
然而,全页不能正常工作。我无法滚动。 :(这只是工作,如果我把节标签内的index.html这意味着:
<html>
<head>
....
<link rel="stylesheet" type="text/css" href="styles/jquery.fullPage.css" />
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/jquery.fullPage.min.js"></script>
<script type="text/javascript" src="js/jquery.fullPage.js"></script>
<script>
$(document).ready(function() {
$('#fullpage').fullpage();
});
</script>
</head>
<body>
<div class="container" id="fullpage">
<section id="home_section1" class="section">
some text
</section>
<section id="home_section2" class="section">
some text
</section>
</div>
</body>
</html>
任何人都可以请帮我:(
您是否查看了[fullpage.js文档的资源部分](https://github.com/alvarotrigo/fullPage.js#resources)中的angular directives列表? – Alvaro
您必须从组件的ngOnInit方法中初始化整页。 'ngOnInit():void {('#fullpage')。fullpage(); }' – Alexus