Home page banner loading issue

Issue: We have an issue with home page banner which is customized section developed by extension. When we enter into any other page of the website like category or plp or pdp and landing pages then back to the home page, the banner is missing. Only the next and previous arrows are available in the banner section.

Solution:

Instead of extending the initSlider inside the initialize function we tried the method shown below

, initialize: function (options) {


                var self = this;
                this.on('afterViewRender', function afterViewRender() {
                    _.defer(function (params) {
                        self.initSlider();
                    })
                })
                var sliderDetails = SC.CONFIGURATION.get('Homepageslidersubtab.items');             
                var sliderData = _.map((sliderDetails || []), function map(item) {
                    item.heading = item.heading.slice(0, 75);
                    item.description = item.description.slice(0, 230)
                    item.bannerimg = Utils.getAbsoluteUrlOfNonManagedResources(item.bannerimg);                 
                    return item;
                });
                this.sliderData = sliderData;
            }


            ,initSlider: function initSlider() {
                var self = this;
                _.defer(function () {
                    Utils.initBxSlider(self.$('[data-slider]'), {
                        auto: true,
                        autoStart: true,
                        pause: 5000,
                        nextText: '<a class="home-gallery-next-icon"></a>',
                        prevText: '<a class="home-gallery-prev-icon"></a>'
                    });
                    setTimeout(function () {
                        if ($('.home-image-slider-li-component').length) {
                            $('.home-image-slider-li-component').css("width", jQuery(window).width());
                        }
                    }, 1000);
                }, 2000)
            }

Leave a comment

Your email address will not be published. Required fields are marked *