2012-07-01 1 views
1

다른 비디오를로드하는 페이지가 있습니다. 뭔가 의미가있는 경우 jw 플레이어를 플레이어로 사용합니다. 그리고 제 문제는 꽤 유선입니다 ... JW 플레이어는 첫 번째 비디오 만 재생합니다. 어떤 링크를 클릭하든 관계없이 항상 첫 번째 비디오가 재생되었습니다.루프에서 비디오를로드 중 ... 항상 firist 비디오가 표시됩니다 - jquery 문제?

소스 코드 (실행 된 html)가 보이면 비디오가 올바르게로드됩니다. img1, video1.flw 링크, img2 video2.flw 링크 ... 등등. 그러나 어떤 링크를 클릭하든 관계없이 첫 번째 비디오 만 재생됩니다.

누구나 이것이 일어날 수있는 이유를 알아낼 수 있습니까 ??? 내가 헤더에이 코드가

: 여기

는 비디오와 관련이 코드

<link href="style.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="js/jquery-1.7.1.js"></script> 
<script type='text/javascript' src='js/jquery.simplemodal.js'></script> 
<script type='text/javascript' src='js/basic.js'></script> 
<script type="text/javascript" src="jwplayer/jwplayer.js"></script> 

을 그리고 이것은 비디오가 배치되는 코드입니다 :

<div id='basic-modal'> 
<a href='#' class='basic'> 
<img src="backOffice/backOfficeImages/<?php echo $r[instrument_image]; ?>" alt="" width="300" height="410" /> 
</a> 
</div> 

<!-- modal content --> 
<div id="basic-modal-content"> 
<!-- START OF THE PLAYER EMBEDDING TO COPY-PASTE --> 
<div id="<?php echo $i;?>">JW Player goes here</div> 

<script type="text/javascript"> 
jwplayer("<?php echo $i;?>").setup({ 
flashplayer: "/jwplayer/player.swf", 
autostart:true, 
file: "backOffice/videos/instruments/<?php echo $r[instrument_video]; ?>", 
height: 360, 
width: 640 
}); 
</script> 
<!-- END OF THE PLAYER EMBEDDING --> 
</div> 
<!-- preload the images --> 
<div style='display:none'> 
<img src='images/x.png' alt='' /> 
</div> 

<?php 
$i++; 
?> 

$ i varable은이 코드가있는 while 루프 위에 0으로 설정됩니다. 동일한 루프에서도 이미지가 올바르게 표시되고 소스 코드 비디오가 정확하지만 (video1, video2, video3 ...) 첫 번째 비디오 만 재생되며 클릭 한 이미지는 없습니다.

누구든지 도움이 될 수 있나요 ??

안부, 조란

답변

1

나는 특정 모달를 열고 각 링크를 알려줍니다 아무것도 볼 수 없습니다 - 나는 그냥 첫 번째마다에 디폴트 상상 것이다.

모두는 js/jquery.simplemodal.js 및 js/basic.js (링크를 연결해야하는 코드)의 내부 내용에 따라 다릅니다.

링크 (0,1,2,3)와 링크가 포함 된 무언가가 보일 것으로 예상됩니다.이 링크를 사용하여 link3을 modal3에 바인딩 할 수 있습니다. 어디

<div id='basic-modal' data-index="<?php echo $i;?>"> 
    ... 
</div> 


<div id="basic-modal-content" data-index="<?php echo $i;?>"> 
    ... 
</div> 

그때 basic.js의 내부에이 곳과 같은 코드를 상상 (또는 :

예 (그러나 다시 당신이 작업 답변의 링크를 설정하는 방법에 대한 자세한 정보가 필요합니다) 링크)를 미혹 :

// hook up the video links to launch the correct modal 
$('div#basic-modal').bind('click', function() { 

    // grab the index of the link that was clicked 
    var linkIndex = $(this).attr('data-index'); 

    // get a reference to the corresponding modal 
    var modal = $('div#basic-modal-content[data-index="' + linkIndex + '"]'); 

    // use whatever code you need to show the modal window 
    modal.show(); 
}); 

을 다시 - 기본적인 아이디어는 각 링크는 무엇 창을 실행해야로서 생각의 일종이 있어야하고 링크를 클릭 할 때 참조를 얻기 위해 이것을 사용한다는 것입니다 올바른 비디오 모달.

+0

$ (문서) .ready (함수() { jQuery를 (함수 ($) {페이지로드에 \t //로드 대화 \t //$('#basic-modal-content').modal();. \t $은 ('기본 모달 .basiC#')을 클릭 클릭에 \t //로드 대화 상자 (기능 (전자) { \t \t $ ('# 기본 모달 콘텐츠').모달(); \t \t false를 반환합니다. \t}); }}); }} 다음은 basic.js – Zoran

+0

의 코드입니다. 엄청 고마워. 이 도움으로 하루를 절약 할 수 있습니다. cheeres, zoran – Zoran

관련 문제