Please help me with the js code

1 reply · opened Nov 14, 2023

KKal_HoangNov 14, 2023

Hi,

I like the way you build the template with async js. But I don't know how to use the plugin within my html. Ex: I want to have a flex slider (with thumbnail nav) on my page. I tried this way but it's not work:


    
        
            
                
                    
                        [
![attachment](https://loremflickr.com/1920/1280?random=1)
](#)
                        [
![attachment](https://loremflickr.com/1920/1280?random=2)
](#)
                        [
![attachment](https://loremflickr.com/1920/1280?random=3)
](#)
                    
                
            
        
    
        
    

window.addEventListener('pluginFlexSliderReady', () => {
    var flexpParent = new FlexSlider('.slider-wrap', {
        animation: "slide",
        controlNav: "thumbnails"
    });
});

Thanks

SSemicolon WebSTAFFNov 17, 2023

Hello,

The Codes you are using is incorrect. Please follow the steps below:

  1. Add the .customjs Class to the .fslider Element. Example:
    [ch_pre][/ch_pre]

  2. Use this JS Code as follows:
    [ch_pre type="js"]window.addEventListener('pluginFlexSliderReady', function() {
    jQuery('.fslider .flexslider').flexslider({
    selector: '.slider-wrap > .slide',
    animation: 'slide',
    controlNav: 'thumbnails',

    });
    });[/ch_pre]

This should definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard