v2.5.2
Giriş yap

_GET ile modal göstermek

pcmemo
896 defa görüntülendi

butona tıklamak yerine adres satırındaki bir GET ğarametresini gördüğünde modal penceresi açmak istiyorum.

Nasıl yapabilirim?

pcmemo
1493 gün önce

Aşağıdaki gibi yaptım. Modal açılıyor ama içerik koyu duruyor sayfanın geneli gibi ve hiç bir içeriğine tıklanmıyor.

<?php if ($_GET['id']=='parametre') { ?>

<div class="modal fade" id="<?php echo $_GET['id'] ?>">
                        <div class="modal-dialog modal-lg modal-dialog-centered">
                          <div class="modal-content">
                            <div class="modal-header">
                              <h4 class="modal-title"><?php  echo $row['Marka'] ?> - <?php  echo $row['Collection'] ?> - <?php  echo $row['UrunTip'] ?> - <?php  echo $row['Carat'] ?> Ayar</h4>
                              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                              </button>
                            </div>
                            <div class="modal-body">

                              <iframe width="768" height="432" src="https://www.youtube.com/embed/<?php echo $row['youtube_key'] ?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"></iframe>

                            </div>
                            <div class="modal-footer justify-content-right">
                              <button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>
                              <button type="button" onclick="window.location.href='Product.php?UrunID=<?php echo $row['UrunID']; ?>'" class="btn btn-primary">Ürün Detaylarına Git</button>
                            </div>
                          </div>
                        </div>
                      </div>
<script>
$( document ).ready(function() {
$("#<?php echo $_GET['id'] ?>").modal('show');
});
</script>
<?php } ?>