- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在努力创建从介绍页面到主页的平滑过渡,您可以在此处看到 http://trial.kareemhackett.com所以我使用了 smoothstate.js 但我无法让它在页面之间平滑过渡,我觉得这是因为我有图像作为背景,这与任何演示都不一样。但希望这可能不是我把它带到这里的情况。可能是因为我使用的是 Bootstrap ?
这是我的代码。我也尝试过 reveal.js,尽管这有点不同,我只需要合并平滑过渡。
非常感谢任何帮助。
$(function(){
'use strict';
var $page = $('#main'),
options = {
debug: true,
prefetch: true,
cacheLength: 2,
onStart: {
duration: 250, // Duration of our animation
render: function ($container) {
// Add your CSS animation reversing class
$container.addClass('is-exiting');
// Restart your animation
smoothState.restartCSSAnimations();
}
},
onReady: {
duration: 0,
render: function ($container, $newContent) {
// Remove your CSS animation reversing class
$container.removeClass('is-exiting');
// Inject the new content
$container.html($newContent);
}
}
},
smoothState = $page.smoothState(options).data('smoothState');
});
.intro {
background: url(img/headerbg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
height: 100vh;
}
.site-wrapper {
display: table;
width: 100%;
height: 100%; /* For at least Firefox */
min-height: 100%;
-webkit-box-shadow: inset 0 0 100px rgba(0,0,0,.5);
box-shadow: inset 0 0 100px rgba(0,0,0,.5);
}
.site-wrapper-inner {
display: table-cell;
vertical-align: middle;
}
.cover-container {
margin-right: auto;
margin-left: auto;
}
.inner {
padding: 30px;
}
.cover {
padding: 0 20px;
}
<div id="main" class="m-scene">
<div class="scene_element scene_element--fadeinright">
<div class="intro">
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="inner cover">
<a class="center-block" href="newhome.html" data-transition="fade"><img class="img-responsive" src="img/Bang_logo.png"></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
最佳答案
您似乎没有使用 CSS 定义任何动画。所以 m-scene、scene_element、scene_element--fadeinright 和 is-exiting
没有做任何事情。
smoothState.js 似乎可以正常工作,不过,它正在通过 ajax 替换内容并按照指定添加 is-exiting
类。
关于html - smoothstate.js 是否不适用于不同的背景图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30926047/
我的网站在每个页面上都使用 smoothstate.js。在几页上,我弹出一个带有表单的模式框。这些表格工作得很好。 在另一个页面上,我有一个包含在 html 中的基本表单。当我单击表单上的提交按钮时
我目前正在尝试在我的网站上实现 smoothState.js。然而,我在页面之间转换时遇到了问题。 问题在于新内容是“无样式的”(更准确地说,它的样式与上一页的样式相同)。由于我非常关注此网站的性能,
我正在一个网站上工作,我决定将 smoothstate.js 插入其中。我已经按照有关如何安装它的指南进行操作并且能够安装它,但是我只有一个问题。加载页面时会执行介绍动画,但是当我单击链接并加载另一个
我正在使用插件 smoothstate.js在我的网站上。出于某种原因,当我使用后退和前进按钮浏览页面时,后退按钮有时会停止工作。 URL 变了,但内容保持不变? 我已经检查了控制台显示的错误: Ty
我的网站在大多数页面上都有类似 slider 的元素。我正在尝试实现 SmoothState JS,但遇到了第二页中断的问题。通过文档我知道我可能需要添加 onAfter 回调,但我想知道在哪里以及如
我已经成功实现了 smoothState.js我的网站上有一个插件,它工作得很好,但我的另一个非常简单的 jQuery 插件将无法工作,其开头为: $(document).ready() 我需要刷新页
在 smoothstate.js 库中场景元素的反向动画有一些问题。我在网站上工作:LINK 实际上“.is-exiting”类适用于 DOM 但动画没有发生这是我的 CSS: .animated .
当单击链接 smoothstate 加载新页面的内容时,我想用新页面上可见的类来标识引用页面。有什么办法可以做到这一点吗? 最佳答案 这不是最动态的解决方案,但我最终所做的是将类设置为引用页面上的 a
我尝试嵌入 smoothState.js进入我的元素。但是出于任何原因,“动画方向:交替反转;”不工作(或其他)。该元素只是淡入而不是淡出。我尝试了一切,但没有任何效果。 html archiv
我正在使用 smoothstate.js 进行页面转换,但每当我单击转到另一个页面的链接时,我都无法尝试让动画退出。自动画正常启动以来,页面加载时我没有问题。仅退出时页面将正常退出,没有任何过渡或动画
我正在努力创建从介绍页面到主页的平滑过渡,您可以在此处看到 http://trial.kareemhackett.com所以我使用了 smoothstate.js 但我无法让它在页面之间平滑过渡,我觉
我尝试将 smoothState.js 嵌入到我的元素中,但出于任何原因,reverse/toogle/exiting 动画无法正常工作。我真的没有更多的想法,我找不到关于 stackoverflow
当所有内容完全加载时,我需要页面加载器到每个页面。 我需要什么: $(window).load(function(){ $('#loading').fadeOut(); }); 当 Smooth
我正在使用 Smoothstate.js 向我的网站添加页面转换,并尝试使用 onStart、onProgress 和 onReady 函数在每个页面转换之间显示一个加载页面。 我的代码有效,但它时不
我正在使用 SmoothState.js 进行页面转换,它工作正常并使用 ajax 加载新页面。但是,我在每个需要重新初始化的页面上都有 JS 脚本,但我无法让它们始终出现在页面转换中。 Based
我正在构建一个简单的网站,我想使用来自 SmoothState.js 的漂亮转换,但我也使用了其他 jQuery 脚本(例如 Flexslider ),我已将其设置为在 $(document).rea
我知道这个问题在很多地方都被问过,但我还没有找到适合我的情况的答案。 我使用 smoothstate.js 在页面加载时触发一系列动画,并(希望)在页面退出时反转动画。 在页面加载时效果很好,但在反转
我正在尝试使 smoothState.js 插件正常工作。单击从 index.html 到 secondary.html 的链接后,动画会产生相反的效果但不会导致 secondary.html,实际上
我在“header.php”页面的代码中使用带有简码的 Wordpress 音频播放器。 我也在使用 SmoothState ( http://miguel-perez.github.io/smoot
我正在尝试使用 Masonry和 smoothState在页面之间使用 SmoothState 动画一起使用。 下面的代码使 smoothState 动画可以向前和向后工作: $(function()
我是一名优秀的程序员,十分优秀!