此代码可以在Chrome和Firefox上运行。但只是野生动物园不能使它工作......现在有什么问题? jQuery的应该是没有问题,运行在所有浏览器..Jquery .click()不适用于safari ..但在其他浏览器上工作
点击功能元素是在按钮标签。
$(document).ready(function() {
$('#loading-icon').hide();
$('.complete-order').click(function() {
$('#loading-icon').show();
$(function() {
count = 0;
wordsArray = [" Please wait... loading...", " Don't close your browser...", " We are setting up your website...", " Running the system..." , " Almost complete..."];
setInterval(function() {
count++;
$("#loading-icon span").fadeOut(400, function() {
$(this).text(wordsArray[count % wordsArray.length]).fadeIn(400);
});
}, 2000);
});
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="text-center padding-loading">
<div id="loading-icon">
<i class="fa fa-spinner fa-spin"></i>
<span> Please Wait... Loading...</span>
</div>
</div>
<button type="submit" id="btnCompleteOrder" class="complete-order btn btn-primary btn-lg" onclick="this.value='{$LANG.pleasewait}'">
button<i class="fa fa-arrow-circle-right"></i>
</button>
什么是附加功能? '(function(){'。这与你的'$(document).ready(function(){'不一样吗? – Rick
摆脱内部'$(function( ){' – Satpal
我已经编辑了我的代码片段..你可以尝试运行它的人 –