D
D
danil_linkins2016-09-11 21:28:48
PHP
danil_linkins, 2016-09-11 21:28:48

Why might the bootstrap modal window not work if everything is done correctly?

I implemented a modal window from bootstrap, scripts and everything else is present, before the window worked and suddenly stopped, it didn’t move an inch in 5 hours. Maybe someone faced such a problem.
Landing address just in case: sportfresh.ru

<div class="dvigay">
                        <?php
                        include "admin/config.php";
                        $result = mysql_query("SELECT * FROM data ORDER BY id");

                          if($result === FALSE) { 
                            die(mysql_error()); // TODO: better error handling
                        }

                          while($myrow = mysql_fetch_array($result))
                        {
                            $a_title = $myrow['title'];
                            $a_date = $myrow['date'];
                            $a_preview = $myrow['preview'];
                            $a_text = $myrow['text'];
                            $a_id = $myrow['id'];

                            ?>
                  <!-- article body -->
                            <div class="col-md-4 facts-item">
                                <div class="article-type">
                                    <img src="img/article.png" alt=""><span>статья</span>
                                </div>
                                <div class="article-link">
                                		<!-- article link -->
                                    <a href="#modal" class="block-scroll-article" data-toggle="modal" data-target="#myModal <?=$a_id?>"><?=$a_title?></a>
                                </div>
                                <div class="article-description">
                                    <p><?=$a_preview?></p>
                                    <div class="article-date">
                                        <span><?=$a_date?></span>
                                    </div>
                                </div>
                                <!-- modal window -->
                                <div class="modal fade" id="myModal'.$a_id.'" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <h1><?=$a_title?></h1>
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <a href="#close" class="close close-modal-bootstrap close-modal-link" data-dismiss="modal" aria-hidden="true">
                                                    <img src="img/close-btn.png">
                                                </a>
                                            </div>
                                            <div class="modal-body">
                                                <?=$a_text?>
                                            </div>
                                            <div class="modal-footer">
                                                <div class="ya-share2 social-icon" data-services="vkontakte,facebook,twitter" data-counter=""></div>
                                                <div class="share-text">
                                                    <p>Поделиться статьей</p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?
                        }
                        ?>
                        </div>

Tested on the window in other places, the window immediately pops up without a call, but it's still not visible, it's somewhere outside the browser window.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pupkin, 2016-09-11
@sakrab

And if you try, instead of:
id="myModal'{$a_id}'"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question