获取无法使用bootstrap轮播脚本读取未定义的属性'offsetWidth' [英] Getting Cannot read property 'offsetWidth' of undefined with bootstrap carousel script

查看:223
本文介绍了获取无法使用bootstrap轮播脚本读取未定义的属性'offsetWidth'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Bootstrap 3.3 创建了 carousel ,它可以在我的本地计算机上运行,​​但是当我上传整个服务器上的东西,其中bootstrap js文件与单个文件中的其他文件一起编译,我收到此错误:

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:

无法读取属性' offsetWidth'of undefined - 有没有人遇到过这个问题,是否有任何已知的解决方案?

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.

这篇关于获取无法使用bootstrap轮播脚本读取未定义的属性'offsetWidth'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆