0
我使用了來自How can I create a "Please Wait, Loading..." animation using jQuery?的Jonathan的示例。我不使用AJAX調用。當用戶點擊我的輸入元素上當用戶點擊某個元素直到頁面加載時顯示加載動畫
$("body").addClass("loading");
$("#select-place input").click(function(){
$("body").addClass("loading");
});
$(window).bind("load", function() {
$("body").removeClass("loading");
});
於第一線,我得到在FF24的動畫圖標:相反,我用這個燒事件。但在IE10中,圖標不旋轉。我做錯了什麼?我試圖預先載入圖像,但這並沒有改變任何東西。
CSS:
.modal {
display: none;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: rgba(255, 255, 255, .8) ;
background-image: url(../images/design/loading.gif);
background-position: 50% 50%;
background-repeat: no-repeat;
opacity: 0.80;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 80);
filter: alpha(opacity = 80)
}
/* When the body has the loading class, we turn
the scrollbar off with overflow:hidden */
body.loading {
overflow: hidden;
}
/* Anytime the body has the loading class, our
modal element will be visible */
body.loading .modal {
display: block;
}
HTML:
<div class="modal"></div>
爲什麼圖標(GIF),不轉?我已測試所有瀏覽器到目前爲止,它的工作原理除了IE ...
我們能看到你的CSS嗎?您正在向正文中添加一個類(奇數),因此效果可能會降低到DOM層次結構。 –
HTML和CSS放置在文檔的末尾。我應該改變它嗎?查看我更新的CSS問題。 – testing