BBC发光轮播:错误:glow.widgets未定义

时间:2012-03-27 17:31:48

标签: javascript slider glow

我使用BBC轮播http://www.bbc.co.uk/glow/docs/1.7/furtherinfo/widgets/carousel/。这是我的脚本代码

<script src="/themes/javascript/glow/1.7.7/core/core.js" type="text/javascript"></script>

<script type="text/javascript">

    glow.ready(function() {
var carousel4 = new glow.widgets.Carousel("#snapwrap",{
        loop: true,
});
});
</script>

它生成Error: glow.widgets is undefined。我做错了什么?

1 个答案:

答案 0 :(得分:1)

好的,我发现了问题:根据http://www.bbc.co.uk/glow/docs/articles/getting_started.shtml

的小部件部分,您没有包含小部件脚本或css

因此,要解决您的错误,您需要修改您的脚本,使其如下所示:

<script src="/themes/javascript/glow/1.7.7/core/core.js" type="text/javascript"></script>
<script src="/themes/javascript/glow/1.7.7/widgets/widgets.js" type="text/javascript"></script>
<link href="/themes/javascript/glow/1.7.7/widgets/widgets.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">

    glow.ready(function() {
var carousel4 = new glow.widgets.Carousel("#snapwrap",{
        loop: true,
});
});
</script>