Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
Jquery ui 我的动画进度条不工作?_Jquery Ui_Progress Bar - Fatal编程技术网

Jquery ui 我的动画进度条不工作?

Jquery ui 我的动画进度条不工作?,jquery-ui,progress-bar,Jquery Ui,Progress Bar,我试图用html编写代码,出于某种原因,当我试图在html文档中运行代码时,这是不起作用的,但我尝试了相同的代码 我的代码正在运行 有没有人可以试试这个代码,给我完整的html代码 <head> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <scri

我试图用html编写代码,出于某种原因,当我试图在html文档中运行代码时,这是不起作用的,但我尝试了相同的代码 我的代码正在运行

有没有人可以试试这个代码,给我完整的html代码

    <head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

  <script>
  $(document).ready(function(){
    var p=0;

    $("#myProgressBar").progressbar({value:0});
        var timer = setInterval(function(){
            //This animates the bar
            $("#myProgressBar .ui-progressbar-value").animate({width: p+"%"}, 500);
            //This does static sets of the value
            //$("#myProgressBar").progressbar("option","value",p);
            p = p +3;
            if(p>33.33){
                $("#myProgressBar .ui-progressbar-value").animate({width: "33.33%"}, 500);
                //$("#myProgressBar").progressbar("option","value",100);
                clearInterval(timer);
            }
    },500);
});
  </script>
  <style type="text/css">
  </style>
</head>
<body style=" background:url(ebay-bar/images/1.jpg) top left no-repeat; width:1099px; height:1050px;">
<a href="2.html" style="width:185px; height:31px;position:absolute; left: 198px; top: 516px;"></a>
<div style="width:954px; position:absolute; top:606px; left: 67px; height: 45px;">  
<div id="myProgressBar" style="height:43px;"></div>
</div>
</body>
</html>

$(文档).ready(函数(){
var p=0;
$(“#myProgressBar”).progressbar({value:0});
var timer=setInterval(函数(){
//这将为该条设置动画
$(#myProgressBar.ui progressbar值”).animate({width:p+“%”,500);
//这不需要静态的值集
//$(“myProgressBar”).progressbar(“期权”、“价值”,p);
p=p+3;
如果(p>33.33){
$(“#myProgressBar.ui progressbar值”).animate({width:“33.33%”),500);
//$(“myProgressBar”).progressbar(“期权”、“价值”,100);
清除间隔(计时器);
}
},500);
});

您使用jQuery 1.3.2和jQuery UI 1.7.2在JSFIDLE上运行脚本,但是您的html页面包含了jQuery 1.5

替换

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>



您的脚本可能使用了jQuery1.5中不推荐使用的函数,或者jQuery1.5和jQueryUI1.8之间存在一些问题。尝试使用jQuery和jQuery UI的最新版本。

非常感谢,您完全正确!我没话跟你说!我在这里疯了:P
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>