S
S
SLFCM3082020-04-23 18:22:40
phpstorm
SLFCM308, 2020-04-23 18:22:40

How to redo js code so that PhpStorm doesn't complain?

5ea1b2f2d3a79375612238.png
5ea1b29953346564022113.png
If you write this code in HTML, then it works

$(document).ready(function(){
    $('.slider-for').slick({
        slidesToShow: 1,
        slidesToScroll: 1,
        arrows: false,
        fade: true,
        asNavFor: '.slider-nav'
    });
    $('.slider-nav').slick({
        slidesToShow: 4,
        slidesToScroll: 1,
        asNavFor: '.slider-for',
        dots: true,
        centerMode: true,
        focusOnSelect: true
    });
});


but as soon as it is written in the js file, PhpStorm swears at the "$" element and suggests creating a function for it, which I do not know how to remake. For some smart people, the file is included correctly, jQuery is 3.4.1 and plugins for the slider are included.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question