0

I have team-member-slick.js file.

I it has below code ( full code ) :

 $(document).ready(function(){
        $('.vertical-center-4').slick({
            centerMode: false,
            slidesToShow: 2,
            infinite: true,
            rtl: (document.dir === 'rtl'),
            slidesToScroll: 2,
            //speed: 300,
            autoplay: true,
            autoplaySpeed: 3000,
            variableWidth: false,
            arrows: false,
            responsive: [
                {
                    breakpoint: 1024,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 2,
                        infinite: true,
                        dots: false,
                        arrows: false,
                        variableWidth: false,
                    }
                },
                {
                    breakpoint: 600,
                    settings: {
                        slidesToShow: 1,
                        slidesToScroll: 1,
                        arrows: false
                    }
                },
                {
                    breakpoint: 480,
                    settings: {
                        slidesToShow: 1,
                        slidesToScroll: 1,
                        arrows: false
                    }
                }
                // You can unslick at a given breakpoint now by adding:
                // settings: "unslick"
                // instead of a settings object
            ]
        });
    });

as below an example code, I must change showing number value with php from a php file:

$('.multiple-items').slick({
  infinite: true,
  slidesToShow: 3,
  slidesToScroll: 3
});

all slidesToShow: 3, numbers must be depend a php variable because I will write a control panel this number.

So, how can I access js number variable from php file?

I will change the number with php saving ( after save button clicking ) then, the variable will load from server after re-load the customer page to change slide showing item number.

Faruk rıza
  • 68
  • 1
  • 6
  • PHP can't directly access JS variables because PHP is executed on the server and JS is executed on the client (browser). You will need a XMLHttpRequest to send the values to the server. Read more about server-sided and client-sided programming: https://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming – jrswgtr Nov 14 '20 at 11:24
  • thanks, I will look at xmlhttprequest – Faruk rıza Nov 14 '20 at 12:59

0 Answers0