Jump to content
  • 0

bootstrap 3 dialog


https
 Share

Question

модальное окно

<!-- Modal "client" --><div class="modal fade" id="client-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">    <div class="modal-dialog modal-sm">        <div class="modal-content">            <div class="modal-body">                ...            </div>        </div><!-- /.modal-content -->    </div><!-- /.modal-dialog --></div><!-- /.modal -->

код вызова модального окна

$(document).on('click', 'a.link-modal', function(event){        event.preventDefault();        var url = $(this).attr('href');        var clickedbtn = $(this);        var modalContainer = $('#client-modal');        var modalBody = modalContainer.find('.modal-body');        //modalContainer.modal({show:true});        $.ajax({            url: url,            type: "GET",            data: {/*'userid':UserID*/},            success: function (data) {                $('.modal-body').html(data);                modalContainer.modal();            }        });    });

как правильно сделать автовыравнивание ширины под контент?

счас сделал по рабоче-крестьянски <div class="modal-dialog modal-sm" style="width:50%">

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Я не знаю с чего ты взял, но JQ UI Dialog по умолчанию имеет ширину, равную 300px, о чем сказано в API: http://api.jqueryui.com/dialog/#option-width
Что же касается Bootstrap, то Modal легко можно "научить" иметь ширину, равную контенту: https://jsfiddle.net/klierik/s8u2rozd/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy