我使用smoothState.js最基本的使用html和css工作正常
;(function ($) {
$('#main').smoothState();
})(jQuery);
Run Code Online (Sandbox Code Playgroud)
然而,即使使用此基本实现,如果您选择当前页面的链接(即重新加载页面),您将获得一个空白的白色屏幕,其中左上角写有2015.有了这个错误,控制台中没有记录错误,这让我认为这是一个由smoothState.js处理的错误
如果我扩展smoothState以允许更高级的选项(即'is-exiting'),现在无法浏览网站,移出页面.
使用高级实现,在这个问题的最后显示我得到控制台错误:
Uncaught TypeError: content.toggleAnimationClass is not a function main.js:134
$.smoothState.onStart.render @ main.js:134
load @ jquery.smoothState.js:533
clickAnchor @ jquery.smoothState.js:589
n.event.dispatch @ jquery.min.js:3
n.event.add.r.handle @ jquery.min.js:3
Run Code Online (Sandbox Code Playgroud)
这是html:
<head></head>
<body>
<div id="main" class="m-scene">
<header id="header">
</header>
<div id="page_content_container" class="scene_element scene_element--moveUpIn">
<section class="about-intro-container">
</section>
<section class="about-services-container">
</section>
<section class="about-randomBits-container">
</section>
<footer>
</footer>
</div><!-- #page_content_container -->
</div><!-- …Run Code Online (Sandbox Code Playgroud)