1
我們有一個ajax腳本,用於獲取單詞並將一些相關數據加載到div標記中。將預加載器添加到div標記
它工作正常,但我們要添加預加載(無jQuery的)到div標籤,我們試圖spin.js但它僅適用於整個頁面,這就是我們所做的:(彙總)
<head>
<script src="spin.min.js"></script>
</head>
<body>
<div id="data">
//data loads here
</div>
<script type="text/javascript" charset="utf-8">
var opts = {
lines: 13, // The number of lines to draw
length: 7, // The length of each line
width: 4, // The line thickness
radius: 28, // The radius of the inner circle
rotate: 0, // The rotation offset
color: '#000', // #rgb or #rrggbb
speed: 1, // Rounds per second
trail: 92, // 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('data');
var spinner = new Spinner(opts).spin(target);
</script>
</body>
是什麼錯誤? 和任何其他(和更好的)解決方案?
但是:1 - spining的工作,直到整個頁面加載(圖片,logoes等)2 - 當測試ajax它加載數據沒有任何加載飛濺。 –
你是如何初始化你的旋轉ajax開始? – mprabhat
似乎它的重點..如何做到這一點? (我是阿賈克斯/裝載機處理noobot) –