我使用asp mvc,我需要使用spin.js,但不工作。這是我正在使用的代碼。錯誤,當我使用JavaScript的spin.js庫
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>spin.js example</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/spin.js/1.2.7/spin.min.js"></script>
</head>
<body>
<div id="foo"></div>
<script>
var opts = {
lines: 10, // 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: 25, // Top position relative to parent in px
left: 25 // Left position relative to parent in px
};
var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);
</script>
</body>
</html>
但是當我運行一個異常顯示,該行
var spinner = new Spinner(opts).spin(target);
和消息是
「沒有定義微調」
任何想法我如何解決這個問題?
我得到同樣的錯誤 「微調沒有定義」。 – Wilmer 2014-10-16 21:50:16
我看到spin.min.js被正確下載,這個問題很奇怪,因爲我可以在互聯網上看到示例並且它們可以工作,但是當我將該代碼放到我的應用程序中時無法正常工作。 – Wilmer 2014-10-16 21:51:32
@ user3303841然後您必須有其他問題。確切的代碼(在src中使用http)正在我的機器上運行。 – 40Alpha 2014-10-16 21:56:20