jquery ui progressbar destory

最近用jquery ui progressbar 遇到问题。 所有的demo里都没有用 api里写的destory方法。但是我现在想在结束的时候直接销毁掉progressbar,有人有demo用过destory方法的么?

阅读 3.7k
1 个回答
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>progressbar demo</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
    <script src="http://code.jquery.com/jquery-1.12.4.js"></script>
    <script src="http://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body>
    <div id="progressbar"></div>
<script>
$("#progressbar").progressbar({
    value: false
});
setTimeout(function() {
    $("#progressbar").progressbar('destroy');
}, 5000);
</script>
</body>
</html>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进