S
S
Skrolea2016-03-28 13:05:38
Yii
Skrolea, 2016-03-28 13:05:38

Why doesn't the modal window open?

I am using Bootstrap3 and Yii2 with yii2-scroll-pager plugin

<div class="col-lg-4 col-sm-6 col-xs-12 item">
    <a href="#" data-toggle="modal" data-target=".pop-up-<?= $model->id ?>">
        <img src="/<?= $model[url] ?>" class="thumbnail img-responsive">
    </a>
</div>


<div class="modal fade pop-up-<?= $model->id ?>" tabindex="-1" role="dialog" aria-labelledby="myLargeModalPhoto" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>              
            </div>
            <div class="modal-body">
                <img src="/<?= $model[url] ?>" class="img-responsive img-rounded center-block" alt="">
            </div>
            <div class="modal-footer">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">share</button>              
            </div>
        </div>
    </div>
</div>

$dataProviderconfigured to issue 6 photos.
So in the first 6 photos, a modal window opens. The rest don't. Everything is correct in the console. id is added to each pop-up-<?= $model->id ?true. What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-03-28
@webinar

Is the modal script enabled? It is connected in yii2 when the widget is called, if you manually created a modal window, then you need to manually connect the script

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question