2011-05-02 2 views
0

jquery-lightbox-0.5 http://leandrovieira.com/projects/jquery/lightbox/ 사용하고 있습니다.jquery 라이트 박스 0.5 숨겨진 링크에 오류가 발생했습니다. 그것을 고치는 방법?

$('.zoomLightbox a').lightBox(); 

Html

<p class="zoomLightbox"> 
<a rel="lightbox" class="zoomPhoto" title="abc" href="images/products/lightbox-zoom-placeholder.gif">View larger photo</a> 
<a style="display: none;" rel="lightbox" class="zoomPhoto hide" title="abc" href="images/products/lightbox-zoom-placeholder.gif">View larger photo</a> 
... 
</p> 

첫 번째 링크 나머지는 제외됩니다. 이제 문제는 두 번째 img로 이동 한 다음 첫 번째 이전 링크로 돌아갈 때 여전히 활성 상태이며 이전 링크를 클릭하면이 오류가 발생합니다.

settings.imageArray[settings.activeImage] is undefined 
[Break On This Error] objImagePreloader.src = settings.imageArray[settings.activeImage][0]; 

어떤 도움을 주셨습니다.

때만 해당 hapening fixedNavigation : true

답변

0

post를 참조하고, 끝 부분에 추가 의견을 읽고 : fixedNavigation는 경우에만이 생긴

그것.

:: UPDATE : 야, 내가 구현하여 주어진 샘플 코드, 내 말에 그 작업을 미세에 따라 예 ....

html로 코드 :

<%@page contentType="text/html" pageEncoding="UTF-8"%> 

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
     "http://www.w3.org/TR/html4/loose.dtd"> 

    <html> 
     <head> 
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
      <title>JSP Page</title> 
      <script type="text/javascript" src="jquery-1.5.2.js"></script> 
      <script type="text/javascript" src="jquery.lightbox-0.5.js"></script> 
      <link rel="stylesheet" type="text/css" href="jquery.lightbox-0.5.css" media="screen" /> 
      <script type="text/javascript"> 
       $(document).ready(function() { 
        $('.zoomLightbox a').lightBox(); 
       }); 
      </script> 
     </head> 
     <body> 
      <p class="zoomLightbox"> 
       <a rel="lightbox" class="zoomPhoto" title="abc" href="img_1.png">View larger photo</a> 
       <a style="display: none;" rel="lightbox" class="zoomPhoto hide" title="abc" href="img_2.png">View larger photo</a> 
      </p> 
     </body> 
    </html> 

enter image description here

,691 :

그리고 다음은 프로젝트 구조

위의 코드를 확인하고 필요한 js 및 css 파일을 올바르게 포함했는지 확인하십시오.

+0

그것은 나를 위해 작동하지 않습니다 ... 내가 방화범을 통해 검사 할 때 lightbox-nav-btnPrev가 디스플레이와 함께 있다는 것을 알았지 만, 내 경우에는 그렇지 않습니다. 나는 그것의 완료된 – bin

+0

내 업데이트 된 답변을 확인하는 방법을 찾을 수 없습니다, 그것은 작동 예제가 ... – Nirmal

0

<img /> 태그가 누락 된 것 같습니다. 플러그인 문서에 따르면, 마크 업이 다음과 같아야합니다

<p class="zoomLightbox"> 
<a rel="lightbox" class="zoomPhoto"> 
    <img title="abc" src="images/products/lightbox-zoom-placeholder.gif" /> 
    View larger photo 
</a> 
<a style="display: none;" rel="lightbox" class="zoomPhoto hide" > 
    <img title="abc" src="images/products/lightbox-zoom-placeholder.gif" /> 
    View larger photo 
</a> 
... 
</p> 

편집을 : 나는 <img> s는 플러그인에 대한 필수 아니라는 것을 깨달았다. 이 답변을 업데이트 할 때까지 기다려주십시오.

1

나는

이동이 194

objImagePreloader.src = settings.imageArray[settings.activeImage][0] 

변화에

if (settings.imageArray[settings.activeImage]) { 
       objImagePreloader.src = settings.imageArray[settings.activeImage][0]; 
      } 
      else { 
       _finish(); 
       return false; 
      } 

희망이 도움을 줄 수는 플러그인

을 수정해야한다고 생각!

관련 문제