• 29-07-2025, 23:47:48
    #10
    Konfor adlı üyeden alıntı: mesajı görüntüle
    <?php if (!empty($row['video_url'])): ?>
    <div class="video-toggle">
        <button class="video-button" onclick="toggleVideo(event, this)">
            <?= htmlspecialchars($row['title']) ?> - İzle
        </button>
        <div class="video-container" style="display:none;">
            <a class="video-button" href="<?= htmlspecialchars($row['video_url']) ?>" target="_blank">
                Videoyu İzle
            </a>
        </div>
    </div>
    <?php endif; ?>
    
    <script>
        function toggleVideo(event, button) {
            // Varsayılan davranışı engelle
            event.preventDefault();
            
            // Video container'ı göster/gizle
            var videoContainer = button.nextElementSibling;
            
            // Eğer video-container gizli ise, linki göster
            if (videoContainer.style.display === 'none' || videoContainer.style.display === '') {
                videoContainer.style.display = 'block';
            } else {
                videoContainer.style.display = 'none';
            }
        }
    </script>
    Bu kodu dener misin chatgpt abim verdi

    haha denedim siteye ulaşmıyor oldu eskine getirdim geri. Olmadı
  • 29-07-2025, 23:49:07
    #11
    amunuyum adlı üyeden alıntı: mesajı görüntüle
    haha denedim siteye ulaşmıyor oldu eskine getirdim geri. Olmadı
    Yok verdiği koda baktım zaten yanlış anlamış olayı
  • 29-07-2025, 23:51:55
    #12
    Konfor adlı üyeden alıntı: mesajı görüntüle
    Yok verdiği koda baktım zaten yanlış anlamış olayı
    Onu nasıl hallederim bilmiyorum bende
  • 30-07-2025, 19:41:41
    #13
    amunuyum adlı üyeden alıntı: mesajı görüntüle
    Evet iki kere çıkıyor onu çözmeye çalışıyorum aslında kod şu şekilde ;

    <?php if (!empty($row['video_url'])): ?>
    <div class="video-toggle">
    <button class="video-button" onclick="this.nextElementSibling.style.display = this.nextElementSibling.style.display === 'none' ? 'block' : 'none';">
    <?= htmlspecialchars($row['title']) ?> - İzle
    </button>
    <div class="video-container" style="display:none;">
    <a class="video-button" href="<?= htmlspecialchars($row['video_url']) ?>" target="_blank">
    <?= htmlspecialchars($row['title']) ?> - İzle
    </a>
    </div>
    </div>
    <?php endif; ?>
    </div>
    <?php
    düzeltemiyorum ne yapsam
    bunu kaldır "<button class="video-button" onclick="this.nextElementSibling.style.display = this.nextElementSibling.style.display === 'none' ? 'block' : 'none';">" bu button altaki divi görünür yapıyor gerek yok.
    <div class="video-container" style="display:none;"> burda style kaldırırsan direkt div görünür ve a elementli butonun görünür olacak <div class="video-container">