单击事件更改其他元素的高度后不滚动jQuery视差

单击事件更改其他元素的高度后不滚动jQuery视差,jquery,wordpress,parallax.js,Jquery,Wordpress,Parallax.js,我在wordpress网站上使用Parallax.js。在我的一个页面上,我有一个click事件,当它被执行时,它会向元素(不是视差元素)添加一个类,从而向非视差元素添加高度。不管怎样,当它执行时,我的视差停止滚动 我尝试在我的点击事件中重新触发视差,但没有成功 以下是我的jquery代码: $('.architectural-films').bind('click', function(e){ $(".section1").addClass("toggle"); return

我在wordpress网站上使用Parallax.js。在我的一个页面上,我有一个click事件,当它被执行时,它会向元素(不是视差元素)添加一个类,从而向非视差元素添加高度。不管怎样,当它执行时,我的视差停止滚动

我尝试在我的点击事件中重新触发视差,但没有成功

以下是我的jquery代码:

$('.architectural-films').bind('click', function(e){
    $(".section1").addClass("toggle");
    return false;
});
这是我的css

.section1 {
    max-height: 0px;
    transition: max-height 1.00s ease-out;
    overflow: hidden;
}
.toggle{
    max-height: 5000px;
    transition: max-height 1.30s ease-in;
}
还有我的视差html:

<div data-vc-full-width="true" data-vc-full-width-init="true" data-vc-stretch-content="true" data-vc-parallax="1.5" data-vc-parallax-o-fade="on" data-vc-parallax-image="http://new.sekanskin.com/wp-content/uploads/2018/12/windows-walls-floors.jpg" class="vc_row wpb_row vc_row-fluid what-we-do-service vc_row-has-fill vc_row-no-padding vc_general vc_parallax vc_parallax-content-moving-fade js-vc_parallax-o-fade" style="position: relative; left: -155px; box-sizing: border-box; width: 1440px;"><div class="wpb_column vc_column_container vc_col-sm-12 skrollable skrollable-before" data-5p-top-bottom="opacity:0;" data-30p-top-bottom="opacity:1;" style="opacity: 1;"><div class="vc_column-inner"><div class="wpb_wrapper"></div></div></div><div class="vc_parallax-inner skrollable skrollable-between" data-bottom-top="top: -50%;" data-top-bottom="top: 0%;" style="height: 150%; background-image: url(&quot;http://new.sekanskin.com/wp-content/uploads/2018/12/windows-walls-floors.jpg&quot;); top: -36.3243%;"></div></div>
$('.architectural-films').bind('click', function(e){
    $(".section1").addClass("toggle");
        $(window).trigger('resize.px.parallax');
    return false;
});

我所期望的视差能够在我的点击事件执行后继续滚动。

您使用的是旧的未维护的视差库

如果无法使用其他库,则需要更改此文件中的代码
https://raw.githubusercontent.com/IanLunn/jQuery-Parallax/master/scripts/jquery.parallax-1.1.3.js
。 您必须将此自定义事件侦听器添加到视差构造函数(
$.fn.parallax
):

然后在主脚本中触发事件:

$('.architectural-films').bind('click', function(e){
    $(".section1").addClass("toggle").one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) {
        $(window).trigger('parallax-refresh');
    });
    return false;
});

这不起作用,这是一个wordpress网站使用wpbakery来构建页面。这里是有问题的网站。这已经应用了您的代码。我已经更新了我的答案,让我知道它是否有用。我更新了我的parallax.min.js文件,但那不起作用。
$('.architectural-films').bind('click', function(e){
    $(".section1").addClass("toggle").one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) {
        $(window).trigger('parallax-refresh');
    });
    return false;
});