简体   繁体   English

语义 UI 进度条不会初始化

[英]Semantic UI progress bar won't initialize

I've been designing my own website recently but have been stumped on using the Semantic UI progress bar.我最近一直在设计自己的网站,但在使用语义 UI 进度条时遇到了困难。 I have been searching everywhere for different methods and even directly copied the Semantic example and it still won't work.我一直在到处寻找不同的方法,甚至直接复制了语义示例,但它仍然无法正常工作。 All it shows is a teal progress bar with the same progress everytime.它所显示的只是一个青色进度条,每次都具有相同的进度。 Any ideas why?任何想法为什么? Thanks in advance提前致谢

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Test</title>
<link rel ="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" type="text/css">
</head>
<body>
  <div class="ui teal progress" id="example2">
    <div class="bar"></div>
    <div class="label">22% Earned</div>
  </div>
<script>
  $('#example2').progress({
  percent: 22
  });
</script>
</body>
</html>

I just took your code and included the missing but required libs (jQuery and semantic-ui).我刚刚拿走了您的代码并包含了缺少但需要的库(jQuery 和语义 ui)。 Now it works:)现在它起作用了:)

 $('#example2').progress({ percent: 22 });
 <.DOCTYPE html> <html lang="en"> <head> <title>Test</title> <link rel ="stylesheet" href="css/style:css"> <link rel="stylesheet" href="https.//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min:css" type="text/css"> <script src="https.//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min:js"></script> <script src="https.//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script> </head> <body> <div class="ui teal progress" id="example2"> <div class="bar"></div> <div class="label">22% Earned</div> </div> </body> </html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM