Popup with ajax spinner for twitter bootstrap

Is there a standard popup with ajax spinner in twitter bootstap? While it should be, I haven't found anything about it.

+3


source to share


2 answers


You can use bootstrap modal plugin http://twitter.github.com/bootstrap/javascript.html#modals to load ajax content in popup.



There is no loading way to have a counter, but you can do it yourself before showing the modal popup.

+2


source


This is what worked for me when making an Ajax call using Font Awesome (as recommended in the accepted answer) and changing the modal style a bit:



<!-- CSS -->
<style>
    #spinner-modal .modal-dialog,
    #spinner-modal .modal-content,
    #spinner-modal .modal-body {
        background: transparent;
        color: rgba(255,255,255,1);
        box-shadow: none;
        border: none;
    }
</style>

<!--[ SPINNER MODAL ]-->
<div class="modal fade" id="spinner-modal">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-body text-center">
                <h3><i class="fa fa-cog fa-spin"></i> Working...</h3>
            </div>
        </div>
    </div>
</div>

<!--[ JS ]-->
<script>
        $('#search-form-input').autocomplete({
            source: '/search.php',
            minLength: 2,
            select: function(event, ui) {
                $('#spinner-modal').modal('show');
                var url = '/a/results/index.php?i=' + ui.item.item_id;
                window.location.href = url;
            }
        });
</script>

      

+6


source







All Articles