weixin_33721344 2017-05-20 18:28 采纳率: 0%
浏览 48

Bootstrap Popover加载

Hello I am trying to show "Loading..." text or spinner image until the dynamic ajax content loads because I have a very large number of data to fetch with takes at least 2-3 seconds to fully load here is my Ajax code

$(document).ready(function(){  
     $('[data-toggle="popover"]').popover({  
    trigger: "hover",
    title:fetchData,  
    html:true,  
    placement:'right'  
     });  
     function fetchData(){  
    var fetch_data = '';  
    var element = $(this);  
    var id = element.attr("id");  
    $.ajax({  
   url:"includes/modDashboard/GetSummaryInfo.php",  
   method:"POST",  
   async:false,  
   data:{id:id},  
   success:function(data){  
  fetch_data = data;  
   }  
    });  
    return fetch_data;  
     }  
}); 
  • 写回答

1条回答 默认 最新

  • weixin_33692284 2017-05-20 21:19
    关注

    My solution related to the issue: jshiddle

    <div class="col-lg-6">
        <a href="#" data-toggle="popover1" class="btn btn-block btn-default" id="cash_4">
            Cash Summary
        </a>
    

    Good luck and regards Rtra :)

    评论

报告相同问题?