Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何在wordpress上运行divi主题的路径点?_Jquery_Html_Css_Wordpress_Wordpress Theming - Fatal编程技术网

Jquery 如何在wordpress上运行divi主题的路径点?

Jquery 如何在wordpress上运行divi主题的路径点?,jquery,html,css,wordpress,wordpress-theming,Jquery,Html,Css,Wordpress,Wordpress Theming,Divi主题实现了航路点,有人知道它是如何工作的以及如何使用它们吗?例如,该类允许动画在某个点et航路点,但我需要知道如何操作该事件。它的工作原理是这样的,当您将et航路点类分配给任何divi模块时,它将由用divi JS编写的jQuery自动拾取 <script> (function($) { var $animation_elements = $('.et-waypoint'), $window = $(window); function che

Divi主题
实现了
航路点
,有人知道它是如何工作的以及如何使用它们吗?例如,该类允许动画在某个点
et航路点
,但我需要知道如何操作该事件。

它的工作原理是这样的,当您将
et航路点
类分配给任何divi模块时,它将由用divi JS编写的jQuery自动拾取

<script>
(function($) {
    var $animation_elements = $('.et-waypoint'),
        $window = $(window);

    function check_if_in_view() {
        var window_height = $window.height(),
            window_top_position = $window.scrollTop(),
            window_bottom_position = (window_top_position + window_height);

        $animation_elements.each(function() {
            var $element = $(this),
                element_height = $element.outerHeight(),
                element_top_position = $element.offset().top,
                element_bottom_position = (element_top_position + element_height);

            //check to see if this element is within viewport
            if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {
                $element.addClass('et-animated');
            } else {
                $element.removeClass('et-animated');
            }
        });
    }

    $window.on('scroll resize', check_if_in_view);
})(jQuery);
</script>

(函数($){
变量$animation_elements=$('.et航路点'),
$window=$(window);
函数检查\u如果\u在\u视图()中{
var window_height=$window.height(),
window\u top\u position=$window.scrollTop(),
窗\底部\位置=(窗\顶部\位置+窗\高度);
$animation\u元素。每个元素(函数(){
var$element=$(此),
element_height=$element.outerHeight(),
element_top_position=$element.offset().top,
元素底部位置=(元素顶部位置+元素高度);
//检查此元素是否在视口中
如果((元素底部位置>=窗口顶部位置)和&(元素顶部位置)