Support » Plugin: Slick Slider » trouble using setOption for responsive option

  • Resolved WCat

    (@wcat)


    Hi I am probly just doing something silly but can’t get setOption to work

    in my final js file en queued I have

    
    $( '.slick-slider-wrapper .slick-slider' ).slick( 'setOption', 'responsive', [
    		{
    			breakpoint: 480,
    			settings: {
    				slidesToShow: 1,
    			}
    		},
    		{
    			breakpoint: 768,
    			settings: {
    				slidesToShow: 2,
    			}
    		},
    		{
    			breakpoint: 992,
    			settings: {
    				slidesToShow: 4,
    			}
    		},
    	],
    	true
    	)
    

    This is inside a document.ready. Then the added dep like so

    
    
    wp_register_script('b4st-js', get_template_directory_uri() . '/theme/js/b4st.js', array('slick-slider-core'), false, null, true);
    		wp_enqueue_script('b4st-js');
    

    Has something changed or do you see a mistake in what I am doing?

    Thank you for the plugin.
    Best Regards
    WCat

Viewing 1 replies (of 1 total)
  • DOH just typing it out made me see my mistake.

    
    wp_register_script('b4st-js', get_template_directory_uri() . '/theme/js/b4st.js', array('slick-slider-core'), null, true);
    wp_enqueue_script('b4st-js');
    
    

    final answer.

    Thanks again

    • This reply was modified 1 year, 6 months ago by  WCat.
Viewing 1 replies (of 1 total)
  • The topic ‘trouble using setOption for responsive option’ is closed to new replies.