• Resolved jphilung

    (@jphilung)


    There’s an edge case where the plugin conflicts with previews of forms in Ninja Forms as the preview uses the home page to display the preview. Should the homepage contain the shortcode, the js is enqueued but will fail as Ninja Forms does not display the content of the home page.

    The fix would entail changing the code in dd-parallax-offset.js in order to check for the existance of $(‘.parallax-section, .parallax-mobile’).

    For example :

    jQuery(document).ready(function ($) {
        var parallaxSection = $('.parallax-section, .parallax-mobile');
        if (parallaxSection.length != 0) {
            var pxcontentOffset = parallaxSection.offset().left;
            $('.parallax-content').css('left', '-' + pxcontentOffset + 'px');
            $(".px-mobile-container").each(function () {
                var i = $(this).attr("data-factor") * $(window).width();
                $(this).css("height", i + "px")
            })
        }
    });
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘JavaScript error on edge cases’ is closed to new replies.