$(&#“slider_range")。s​​lider不是函数 [英] $("#slider_range").slider is not a function

查看:116
本文介绍了$(&#“slider_range")。s​​lider不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我已经为Jquery UI添加了google api库,如下所示:

Ok, I have included the google api libraries for Jquery UI, like so:

<script type='text/javascript'  src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js' ></script>

现在我有一个脚本可以更新文档幻灯片上的某些跨度和隐藏输入,而不仅仅是准备好文件:

Now I have a script that updates some spans and a hidden input on document slide and not only, on document ready:

<script type="text/javascript">
            $(document).ready(function()
            {
                 var slider=$('#slider_range').slider({
                        range:true,
                        min:0,
                        max:5,
                        step:1,
                        values:[0,3],
                        slide:function(event,ui)
                        {
                          $('#level').val(ui.values[0]+'-'+ui.values[1]);
                          $('#low').html(ui.values[0]);
                          $('#high').html(ui.values[1]);
                        }
                 });

                 var s=slider;
                 if(s.slider("values",0)==s.slider("values",1))
                 {
                    $('#level').val(s.slider("values",0));
                    $('#low').html(s.slider("values",0));
                    $('#high').html(s.slider("values",0));
                 }
                 else
                     {
                       $('#level').val(s.slider("values",0)+'-'+s.slider("values",1));
                       $('#low').html(s.slider("values",0));
                       $('#high').html(s.slider("values",1));
                     }
              });
         </script>

ideea是在页面上显示滑块而在另一个页面上没有。
我从Firebug收到的错误消息是:

The ideea is that on a page it shows the slider and on another not. The error message I get from Firebug is this:

$("#slider_range").slider is not a function

并指向该行

slide:function(event,ui)

可能导致什么这个?为什么在页面上可以看到滑块和另一个(使用相同的模板加载上面的滑块)可以吗?

What could be causing this? Why on a page the slider can be seen and on another (which uses the same template that loads the above) can`t?

请帮忙!

推荐答案

第二页上有两个不同的jquery库。

There were two differing jquery libraries included on the second page.

这篇关于$(&#“slider_range&quot;)。s​​lider不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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