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.
Yes, that was the fix :) Thanks!
If you compile bootstrap you can fix it by editing the carousel.js for the line
$next[0].offsetWidth
// force reflow Change toif (typeof $next == 'object' && $next.length) $next[0].offsetWidth // force reflow
in my case affecting both active class and also it may also rendred issue dive load before its contain loaded
Awesome! Thanks Man
@fourgablesguy Hi, may I know what do you mean exactly by - compile bootstrap? how can bootstrap be manually compiled? Do u mean building the whole project?