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