2017-03-10 65 views
0

此代码可以在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>

+0

什么是附加功能? '(function(){'。这与你的'$(document).ready(function(){'不一样吗? – Rick

+0

摆脱内部'$(function( ){' – Satpal

+0

我已经编辑了我的代码片段..你可以尝试运行它的人 –

回答

0

我想你可以试试下面的代码。

$(document).on("click",'.complete-order',function(){ 
// You code 
}); 
+0

谢谢..但它仍然是相同的。 –

+0

好吧,我没有这样的错误 –

相关问题