2017-06-26 44 views
1

我似乎無法得到圍繞所有三個圖像的進展圈。這是一個JSFiddle問題。請幫忙!進步圈不去圖片

http://jsfiddle.net/ror37gjk/60/

CSS

.wrapper { 
width: 100px; 
height: 100px; 
} 

.wrapper > #bar, #bar2, #bar3, .wrapper > img { 
width: 100%; 
height: 100%; 
} 

.wrapper > img { 
box-sizing: border-box; 
padding: 4%; 
} 

.wrapper > img { 
border-radius: 50%; 
} 

的JavaScript

var circle = new ProgressBar.Circle('#bar', { 
strokeWidth: 4, 
color: '#000' 

}); 
circle.animate(1); 

var circle = new ProgressBar.Circle('#bar2', { 
strokeWidth: 4, 
color: '#000' 

}); 
circle.animate(1); 

var circle = new ProgressBar.Circle('#bar3', { 
strokeWidth: 4, 
color: '#000' 

}); 
circle.animate(1); 

感謝, 伊恩

回答

1

你可以做這樣的事情:

var circle = new ProgressBar.Circle('#bar', { 
 
    strokeWidth: 4, 
 
    color: '#000' 
 
}); 
 

 
circle.animate(1); 
 

 
var circle = new ProgressBar.Circle('#bar2', { 
 
    strokeWidth: 4, 
 
    color: '#000' 
 
}); 
 

 
circle.animate(1); 
 

 
var circle = new ProgressBar.Circle('#bar3', { 
 
    strokeWidth: 4, 
 
    color: '#000' 
 
}); 
 

 
circle.animate(1);
.wrapper { 
 
    width: 100px; 
 
    height: 100px; 
 
} 
 

 
.wrapper > #bar, 
 
#bar2, 
 
#bar3 { 
 
    position: relative; 
 
} 
 

 
.wrapper > #bar, 
 
#bar2, 
 
#bar3, 
 
.wrapper img { 
 
    width: 100%; 
 
    height: 100%; 
 
} 
 

 
.wrapper img { 
 
    box-sizing: border-box; 
 
    padding: 4%; 
 
    border-radius: 50%; 
 
} 
 

 
.wrapper svg { 
 
    position: absolute; 
 
    top: 0; 
 
    left: 0; 
 
}
<script src="https://rawgit.com/kimmobrunfeldt/progressbar.js/master/dist/progressbar.js"></script> 
 
<div class="wrapper"> 
 
    <div id="bar"><img src="http://i.imgur.com/391FcV0.png" /></div> 
 
    <div id="bar2"><img src="http://i.imgur.com/NtqQEKF.png" /></div> 
 
    <div id="bar3"><img src="http://i.imgur.com/NGROIlB.png" /></div> 
 
</div>

+0

感謝。我在我的CSS,HTML和JavaScript中修復了它。但是,當我打開HTML文件,它沒有動畫。我很確定我有我的JavaScript連接正確。我不知道發生了什麼事。 – ianmtrent

+0

這是一個完全不同的故事......你檢查控制檯中的錯誤? –