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 rel="nofollow noreferrer ugc" 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
<?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
Edit: Tam anlamadı galiba chatgpt
Sen biraz Chatgpt ile ekran görüüntüsü ekle ve derdini anlat yeni kodu verir..