Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery版本升级问题:TypeError:$(…)。滑块不是函数_Javascript_Jquery_Easing - Fatal编程技术网

Javascript jQuery版本升级问题:TypeError:$(…)。滑块不是函数

Javascript jQuery版本升级问题:TypeError:$(…)。滑块不是函数,javascript,jquery,easing,Javascript,Jquery,Easing,我将jQuery版本从2.1.1升级到3.3.1 在版本迁移之后,我无法看到滑块功能正常工作 我已经包括了jquery.min.js和jquery-ui.min.js 如果我遗漏了什么,请告诉我 错误指向的代码段: var slider = $(elem).slider({ range: "min", value: scope.config.mapValues.indexOf(scope.bandwidth), min: scope.con

我将jQuery版本从2.1.1升级到3.3.1

在版本迁移之后,我无法看到滑块功能正常工作

我已经包括了jquery.min.js和jquery-ui.min.js

如果我遗漏了什么,请告诉我

错误指向的代码段:

    var slider = $(elem).slider({
        range: "min",
        value: scope.config.mapValues.indexOf(scope.bandwidth),
        min: scope.config.min,
        step: scope.config.step,
        max: scope.config.mapValues.length-1,
        disabled: scope.disabledFlag,
        slide: function(event, ui) {
            if(ui.value > scope.maxLimit){
                return false;
            }
            scope.$apply(function() {
                scope.slideValue = scope.config.mapValues[ui.value];
            });
        },
        stop: function( event, ui ) {
            if(scope.bandwidth > scope.maxLimit){
                scope._resetBandWidth();
                scope.$apply(function() {
                    var currentValue = scope.config.mapValues[scope.maxLimit];
                    if(ui.value <= scope.maxLimit) {
                        currentValue = scope.config.mapValues[ui.value];
                    }
                    scope.bandwidth = currentValue;
                    scope.slideValue = currentValue;
                });
                return false;
            }
            scope.$apply(function() {
                var bandwidthValue = scope.config.mapValues[ui.value];
                scope.bandwidth = bandwidthValue;
                scope.slideValue = bandwidthValue;
            });
        }
    }).append(disableDiv);
var slider=$(elem).slider({
射程:“分钟”,
值:scope.config.mapValues.indexOf(scope.bandwidth),
min:scope.config.min,
步骤:scope.config.step,
max:scope.config.mapValues.length-1,
禁用:scope.disabledFlag,
幻灯片:功能(事件、用户界面){
if(ui.value>scope.maxLimit){
返回false;
}
作用域$apply(函数(){
scope.slideValue=scope.config.mapValues[ui.value];
});
},
停止:功能(事件、用户界面){
if(scope.bandwidth>scope.maxLimit){
范围;
作用域$apply(函数(){
var currentValue=scope.config.mapValues[scope.maxLimit];

如果(ui.valueHi@Suhasini-Venkatesh

小型JS可能会出现问题。
不要使用
jquery.min.js
而是与您的
jquery ui.min.js
一起使用

<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>

编辑:

Slim显然删除了
jQuery UI
中所需的一些函数。若要解决此问题,请使用jQuery的完整版本。有关更多详细信息,请参阅


希望对您有用。如果您不在评论中告诉我。

您确定您的jquery和jquery ui已加载吗?您可以在控制台中看到它们吗?还有您的元素是什么?请提供更多信息和错误出现的位置,然后可能添加完整错误。请记住,浏览器具有开发人员模式,可能有助于查看更多详细信息查找您看到的错误,并允许您向页面中插入值以进行调试。请检查在添加jQuery UI后是否意外包含了另一个jQuery副本。这通常是缺少插件的原因。我只包含了一个jQuery和jQuery UI副本。我已经包含了jQuery-3.3.1.hi yash的精简版本,而不是ks但包含未压缩版本会破坏整个应用程序UI。我已经包含jQuery slim版本。我希望这会破坏我的滑块功能,错误是“slider不是一个函数”,但如果我包含普通js文件(不是slim而是缩小),则会破坏下拉悬停突出显示功能(所有可用选项一次突出显示)错误为“w.easing不是一个函数”。@Suhasini Venkatesh,我更新了我的答案。检查它,看它是否对您有帮助。我尝试了完整版本的jQuery,正如前面提到的,它打破了下拉悬停突出显示功能(所有可用选项一次突出显示),错误为“放松不是一种功能”。