jQuery的:进度条显示在HTML [英] jquery : progress bar show in html
问题描述
当我将值写入html时,我的进度条工作正常,但是当我从jquery传递值时,它不起作用.例如$('#progresslevel').html(data);
my progress bar is working perfect when i write value into my html but it it dont work when i pass value from jquery .. e.g $('#progresslevel').html(data);
现在我有了这个html,如果我在进度栏中插入值
right now i have this html in which if i insert value into my progress bar it works
<span class="demo-progress" data-progress-options='{"size":false,"style":"large","barClasses":["green-gradient","glossy"],"innerMarks":25,"stripes":true,"darkStripes":false}'>50%</span>
但是如果我在jquery中这样做
but if i do this in jquery
在这里,我从控制器获取值
here i am getting a value from controller
$('.demo-progress').html(data);
它没有用..盒子上只写了50条,没有其他..进度条不出现
it didnt work .. only 50 is written on box and nothing else .. progress bar dont appear
我也通过在span类之后给一个div然后将值传递给div来尝试了这一点,但仍然没有用
i tried this also by giving a div after span class and then pass value to the div but still it didnt work
任何人都知道如何解决此问题
anyone know how to fix this issue
推荐答案
您不应该自己直接修改进度条的组件元素. Progressbar小部件具有一个 API ,您可以使用它来修改进度-具体来说,您应该设置 value
选项:
You should not be directly modifying the progress bar's component elements yourself. The Progressbar widget has an API that you can use to modify the progress -- specifically, you are supposed to set the value
option:
$(".demo-progress").progressbar("option", "value", 50);
这篇关于jQuery的:进度条显示在HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!