便捷转换编码类型
动态进度条
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>进度条</title> <link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css"> </head> <body> <div class="container"> <div class="progress"> <div id="i1" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="1%" aria-valuemin="0" aria-valuemax="100" style=" 0%;"> <span class="sr-only">60% Complete</span> 0% </div> </div> </div> <script src="jquery-3.2.1.min.js"></script> <script> var $d1Ele = $("#i1"); var width = 0; var id = setInterval(setValue, 200); function setValue() { width++; if (width > 100) { clearInterval(id); } else { $d1Ele.css("width", width + "%"); $d1Ele.text(width + "%"); } } </script> <script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script> </body> </html>