HTML jquery-plugin-circliful属性发生了变化

时间:2016-10-13 01:38:40

标签: javascript jquery html css attributes

我想在HTML“div”标签中更改“jquery-plugin-circliful”属性。

“jquery-plugin-circliful”图书馆网址:https://github.com/pguso/jquery-plugin-circliful

我的HTML代码:

<!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>SVG Circliful</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="css/material-design-iconic-font.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/jquery.circliful.css">
</head>
<body>
<section class="container">
<h3>Circliful</h3>
<div class="row">
    <div class="col-lg-2">
        <div id="test-circle" data-percent="11"></div>  **<!-- HERE  -->** 
    </div>
</div>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="js/jquery.circliful.js"></script>
<script>
$( document ).ready(function() { // 6,32 5,38 2,34
    $("#test-circle").circliful({
        animation: 1,
        animationStep: 5,
        foregroundBorderWidth: 15,
        backgroundBorderWidth: 15,
        percent: 38,
        textSize: 28,
        textStyle: 'font-size: 12px;',
        textColor: '#666',
        multiPercentage: 1,
        percentages: [10, 20, 30]
    });
    });
</script>
</body>
</html>

结果:

enter image description here

我不知道为什么百分比值没有改变。我尝试将属性的名称称为“数据百分比”或“百分比”。但任何事情都没有改变。有什么问题?

1 个答案:

答案 0 :(得分:2)

(代表OP发表答案)

网址:jsfiddle.net/me2loveit2/H9gak /

我在库中应用了普通的js文件(jquery-plugin-circliful)。但是当我使用div标签来改变圆圈时,必须添加一些js代码。网址是解决方案。在url中,js脚本(已修复)提供html div属性更改功能。