Tag: smoothstate.js

通过AJAX(smoothstate.js)加载页面时,联系表单7抛出’wpcf7.initForm不是函数’错误

我正在尝试使用smoothstate.js在我的wordpress网站上实现Contact Form 7。 当直接加载使用它的页面时,联系表单可以正常工作。 但是,如果通过AJAX加载页面,则会出现错误’wpcf7.initForm不是函数’。 我不是AJAX的天才,但我的想法是在AJAX onAfter函数中重新初始化。 我试过使用wpcf7InitForm(); 但仍然没有运气。 任何有关此主题的帮助将不胜感激! 这是我目前的AJAX代码: //SmoothState Page Transitions $(function(){ ‘use strict’; var $page = $(‘#main’), options = { debug: true, prefetch: true, onStart: { duration: 800, // Duration of our animation render: function ($container) { // Add your CSS animation reversing class $container.addClass(‘is-exiting’); // Restart your animation smoothState.restartCSSAnimations(); } […]

是否可以同时显示新旧页面?

我正在尝试为smoothstate构建这样的效果: http ://tympanus.net/Development/PageTransitions/,特别是“房间”过渡。 我一下子试图同时显示两个页面 – 我希望新内容能够将旧内容推出屏幕。 很多代码都遵循……一切正常,但它等到旧内容离屏后开始添加新内容 $(function(){ ‘use strict’; var options = { prefetch: true, cacheLength: 10, onStart: { duration: 500, // Duration of our animation render: function ($container) { // scroll up $(“html, body”).animate({ scrollTop: “0px” }); var element = $(‘.row’, $container); // do animations $(element).animate({opacity : 0}, { duration: 500, easing: “linear”, […]