javascript
  • jquery
  • flickr
  • colorbox
  • 2010-06-28 7 views 0 likes 
    0

    [수정 됨 질문]개방 Colorbox

    colorbox를 위해 내가 이미지가 그룹에 클래스 = "슬라이드 쇼"를 사용하고, 그래서 내가, rel 속성을 활용하는 이미지 미리보기 툴팁을 사용하고 있습니다 함께. 이 작업은 정상적으로 수행되었지만 아래에서 볼 수있는 텍스트 링크에서 슬라이드 쇼를 열 수 있기를 원합니다.

    <div id='gallery'> 
         <a href='large.jpg' class="slideshow" rel='medium.jpg'><img src='small.jpg'/></a> 
         <a href='large2.jpg' class="slideshow" rel='medium2.jpg'><img src='small.2jpg'/></a> 
        </div> 
    
    <!--text link--> 
    <a href="#" class="openSlideshow">open slideshow</a> 
    

    다음은 colorbox를 트리거 할 수있는 표준 코드가 어떻게이 슬라이드 쇼를 열어 수정할 수있다 (REL은 = "medium.jpg"이미지 미리보기에 사용되는 이미지입니다)?

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 
    <script src="../colorbox/jquery.colorbox.js"></script> 
    <script> 
          $(document).ready(function(){ 
           $("a.openSlideshow").colorbox({slideshow:true}); 
          }); 
    </script> 
    

    미리 감사드립니다.

    +1

    나는 당신이 ID를 놓쳤다 생각 - – mplungjan

    답변

    2

    저는 컬러 박스 페이지를 살펴 보았습니다. 모든 것이 여기에 설명되어 있습니다. 이것

    봐, 그것은 당신이 뭘 하려는지 정확히 : example 1

    0

    는 그냥 후 동적으로 갤러리를 만들 확장합니다. 나는 카이의 제안을하려고 할 때 예제 페이지 사용

    작동하지 않습니다

    $(document).ready(function() { 
          //dynamacially create the gallery here 
    
          $("a.slideshow").colorbox({ slideshow: true }); 
         }) 
    
    1

    흠 :

    $(document).ready(function(){ 
        //Examples of how to assign the ColorBox event to elements 
        $("a.example4").colorbox({ slideshow: true }); 
    
    
        <h2>Slideshow</h2> 
        <p><a href="../content/ohoopee1.jpg" class="example4" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> 
        <p><a href="../content/ohoopee2.jpg" class="example4" title="On the Ohoopee as a child">Grouped Photo 2</a></p> 
        <p><a href="../content/ohoopee3.jpg" class="example4" title="On the Ohoopee as an adult">Grouped Photo 3</a></p> 
    
    +0

    아래에있는 내 대답은 내가 언급하는 것을 잊었다 I 참조 rel을 사용하지 않고, class = ""를 사용하여 이미지를 그룹화합니다. – Mark

    +0

    DOH. a.slideshow는 클래스 선택 자입니다 ... 그래서 카이의 제안을 시도 했습니까? 예제 페이지를 바꿀 때 나를 위해 작동 - 수정 된 답변보기 – mplungjan

    +0

    실제로 REL을 사용하지 않으면 슬라이드 쇼가 작동하지 않습니다. – mplungjan

    관련 문제