bxslider-4 icon indicating copy to clipboard operation
bxslider-4 copied to clipboard

wrong first slide with html picture tag

Open netfeld opened this issue 5 years ago • 2 comments

The position of the first image is not correct set when using html picture tags insted of img. It shows the bx-clone image on the left. pager shows correctly the first slide.

If i use an slider with image tag (the full width is 1034px) the start image 0 is positioned (id="header_slider"): width: 4215%; position: relative; transition-duration: 0s; transform: translate3d(-1034px, 0px, 0px);

If i use the slider with picture tag the start image (header_slider) is positioned: width: 4215%; position: relative; transition-duration: 0s; transform: translate3d(0px, 0px, 0px);

Any ideas? Thx, Hauke

netfeld avatar Oct 01 '20 09:10 netfeld

Simple Bugfix:

       onSliderLoad: function(){
            //bugfix https://github.com/stevenwanderski/bxslider-4/issues/1284
            //move to first slide
            let firstChild=$(this).children().first();
            let width=firstChild.width();
            $(this).css("transform","translate3d(-"+width+"px,0,0)");
        }

netfeld avatar Oct 01 '20 10:10 netfeld

I had the same problem in Chrome Version 92.0.4515.131 but with tags. I applied this fix and the problem was resolved. Thanks.

BobDenny avatar Aug 03 '21 22:08 BobDenny