I created a carousel
with Bootstrap 3.3
and it works on my local machine, but when I upload the whole thing on server where the bootstrap js file is being compiled together with other files in a single file, I get this error:
Cannot read property 'offsetWidth' of undefined
- has anybody faced this and are there any known solutions to this issue?
For me it was because I hadn't set an active
class on any of the slides.
For me, I changed class='carousel-item'
to class='item'
like this
<div class="item">
<img class="img-responsive" src="..." alt="...">
</div>
Remove the class 'Carousal slide' on page load & add it dynamically when image gets loaded using jquery.This fixed for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With