this page here을 살펴보면 대부분의 경우 Youtube 갤러리 설정이 있음을 알 수 있습니다. 미리보기 이미지를 클릭하면 동영상이 전환되지만 오른쪽의 텍스트가 제대로 전환되지 않습니다. 그것은 비디오 뒤에 텍스트를 로딩하는 것 같고 어떤 경우 오른쪽의 텍스트를 전환하려면 두 번 클릭해야합니다.JQuery - 클릭시 텍스트가 제대로 작동하지 않음
내 jQuery를 살펴보면 누군가가 문제를 판단하는 데 도움을 줄 수 있습니까?
감사합니다.
<script>
function replaceVideo(id) {
originalSrc = jQuery("iframe", "#" + id).attr("src");
autoPlay = originalSrc + "&autoplay=1";
jQuery("iframe", "#" + id).attr("src", autoPlay);
video = jQuery(".video-content", "#" + id).html();
text = jQuery(".video-description").html();
jQuery(".vid_desc").html(text);
jQuery(".flex-video").html(video);
jQuery("iframe", "#" + id).attr("src", originalSrc);
}
jQuery(".video-list li").click(function() {
id = jQuery(this).attr("id");
replaceVideo(id);
});
jQuery(window).load(function() {
if(window.location.search.substring(1)) {
element = window.location.search.substring(1).split('&');
if (document.getElementById(element[0])) {
document.onload = replaceVideo(element[0]);
}
}
});
</script>