javascript - HTML jquery-plugin-circliful 属性更改

标签 javascript jquery html css attributes

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

“jquery-plugin-circliful”库 URL: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

我不知道为什么百分比值没有改变。我尝试将属性名称设置为“数据百分比”或“百分比”。但一切都没有改变。有什么问题吗?

最佳答案

(代表 OP 发布答案)

网址:jsfiddle.net/me2loveit2/H9gak/

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

关于javascript - HTML jquery-plugin-circliful 属性更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40010929/

相关文章:

javascript - Actionscript 3 内联 JavaScript

html - 如何使用 Swift 解码 HTML?

javascript - 单击按钮时更改按钮颜色

javascript - SWT 浏览器未在 Eclipse View 中呈现 Angular 2 页面

javascript - 在 JavaScript 中重新初始化 json 变量

javascript - 如何添加名称已作为另一个属性存在的 JSON 项?

jquery - 我们有一个公共(public)画廊来显示图像和 PDF 吗?

jquery - css 缩放会递减但不会正确递增

javascript - jquery .insertBefore() 导致文本丢失

html - 带有箭头和边框的仅 CSS 工具提示