Tôi đang sử dụng spin.js (http://fgnass.github.com/spin.js/) trong khi hình ảnh có chiều rộng/chiều rộng đầy đủ lớn tải. Vấn đề là tôi gặp rắc rối khi dừng máy quay. Phương thức stop() dường như không hoạt động. Có những gì tôi đã có:Dừng Spinner.js
$(document).ready(function($) {
var img = new Image();
img.src = $('#top-bg').css('background-image').replace(/url\(|\)/g, '');
img.onload = function(){
$("#top-bg").spinner.stop();
$(".top-bar").delay(1500).fadeIn(5000);
$("#arrow, #arrowrt, #top-icons").delay(5000).fadeIn(5000);
};
});
Tôi cũng đã cố gắng
.spin(false)
và
.data('spinner').stop()
Đây là các thiết lập spinner:
$(document).ready(function($) {
var opts = {
lines: 9, // The number of lines to draw
length: 11, // The length of each line
width: 4, // The line thickness
radius: 10, // The radius of the inner circle
rotate: 0, // The rotation offset
color: '#fff', // #rgb or #rrggbb
speed: 0.9, // Rounds per second
trail: 54, // 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('top-bg');
var spinner = new Spinner(opts).spin(target);
});
bạn có thể vui lòng cho chúng tôi biết mã mà thiết lập up spinner? – Niko
Tôi đã thêm cài đặt spinner, nếu đó là ý của bạn. – Connor
Đó là ý tôi, cảm ơn! – Niko