TAB key navigate only in MODAL

Asked

Viewed 133 times

2

Good morning Galera,

I need to make the TAB key navigate only in modal, an example is Twitter that when the Modal message is open or any other, we can not navigate the screen behind through the TAB, someone has idea of how this is done?

1 answer

2


You can use the property tabindex="-1"

<div class="modal fade" id="modal" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button hidden="hidden" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>

            </div>
            <div class="modal-body">
                modal texto
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-
  • Perfect! It worked out!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.