Getting Unable to read the "offsetWidth" undefined property with a carousel loading script

I created carousel with Bootstrap 3.3 and it works on my local machine, but when I upload it all to the server, where the bootstrap js file is compiled along with other files in the same file, I get this error:

Cannot read property 'offsetWidth' of undefined - has anyone come across this and are there any known solutions to this problem?

+45
javascript jquery twitter-bootstrap
Mar 13 '15 at 8:33
source share
4 answers

For me, this was because I did not define an active class on any of the slides.

+122
Apr 11 '15 at 17:25
source share

For me, I changed class='carousel-item' to class='item' as follows

 <div class="item"> <img class="img-responsive" src="..." alt="..."> </div> 
+48
Jul 31 '16 at 16:56
source share

Remove the Carousel Slide class when loading the page and add it dynamically when the image loads using jquery.This fixed for me

+5
Jun 29 '16 at 9:59
source share

I have the same error. Because I used v4 alpha class names like carousel-control-next When I changed from v3, the problem is resolved.

-one
Feb 26 '17 at 23:28
source share



All Articles