로딩 애니메이션을 표시하기 위해 spin.js 라이브러리를 사용하려고합니다. 그러나, 나가는 것은 spin.js developer example 나는 그것이 일하는 것처럼 보일 수 없다/나타납니다; 이것은 Firefox에서 HTML 파일을 열 때 빈 div 태그에 의해 명백합니다. 관심있는 (필요 JQuery와-1.9.0.min.js 및 스핀spin.js가 작동하지 않는 것처럼 보입니다/
<html>
<head>
<script src="spin.min.js">
var opts = {
lines: 13, // The number of lines to draw
length: 7, // The length of each line
width: 4, // The line thickness
radius: 10, // The radius of the inner circle
corners: 1, // Corner roundness (0..1)
rotate: 0, // The rotation offset
color: '#000', // #rgb or #rrggbb
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 'auto', // Top position relative to parent in px
left: 'auto' // Left position relative to parent in px
};
var target = document.getElementById("spinner");
var spinner = new Spinner(opts).spin(target);
</script>
</head>
<body>
<div id="spinner">
</div>
</body>
근무 코드 :
여기 내 코드 (spinnertest.html)입니다. 동일한 디렉토리의 min.js) :
<html>
<head>
<script type="text/javascript" src="spin.min.js"></script>
<script type="text/javascript" src="jquery-1.9.0.min.js"></script>
<script type="text/javascript">
$(function() {
var opts = {
lines: 13, // The number of lines to draw
length: 7, // The length of each line
width: 4, // The line thickness
radius: 10, // The radius of the inner circle
corners: 1, // Corner roundness (0..1)
rotate: 0, // The rotation offset
color: '#000', // #rgb or #rrggbb
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 'auto', // Top position relative to parent in px
left: 'auto' // Left position relative to parent in px
};
var target = document.getElementById("spinner");
var spinner = new Spinner(opts).spin(target);
});
</script>
</head>
<body>
<div id="spinner">
</div>
</body>
그 점에서 과 함께 JQuery 라이브러리를 포함하는 것도 도움이됩니다. 이제 효과가 있습니다. – Akyidrian