Custom javascript functions broken | WordPress.org

[ad_1]

Hello @alien123

There are some parser errors in your code. The issue is caused by the piece of code:

function to360(alpha) {
    if (Math.abs(alpha) > 360)
        let alpha = 360 * (alpha / 360 - floor(alpha / 360));
}
return alpha;
}

There is an extra } parenthesis. Furthermore, the variable is passed as a function parameter, you cannot re-declare it into the function.

So, the correct code would be:

function to360(alpha) {
    if (Math.abs(alpha) > 360)
        alpha = 360 * (alpha / 360 - floor(alpha / 360));
    return alpha;
}

Please, note that it is your own code, not the plugin operations. The support service does not cover debugging the users’ projects. If you need additional help implementing your project, please contact us directly through the plugin website: Contact Us

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer