2010-06-23 6 views
2

내 페이지에 Galleriffic 슬라이드 쇼가 있습니다. 현재 "큰"이미지는 슬라이드 쇼의 다음 이미지로 연결됩니다. 대신 외부 파일에 링크 할 수 있습니까?Galleriffic links

답변

10

먼저, 당신은 당신의 순서가없는 목록에 숨겨진 div 이하 범위 태그를 추가해야합니다 :

<li> 
    <a class="thumb" href="/imageurl/image.gif">imageititle</a> 
    <span id="project-path" style="display:none;">example_path</span> 
</li> 

그런 다음 galleriffic.js 파일에이 코드를 추가합니다. 당신은 스팬 요소에서 경로를 잡아됩니다 다음

addImage: function(listItem, thumbExists, insert, position) { 
        var $li = (typeof listItem === "string") ? $(listItem) : listItem;     
        var $aThumb = $li.find('a.thumb'); 
       ** var $path = $li.find('#project-path'); 
       ** var projectPath = $path.text(); 
        var slideUrl = $aThumb.attr('href'); 
        var title = $aThumb.attr('title'); 
        var $caption = $li.find('.caption').remove(); 
        var hash = $aThumb.attr('name'); 

, 당신은 이미지의 변수에 값을 추가 :

  var imageData = { 
     **  projectPath:projectPath, 
       title:title, 
       slideUrl:slideUrl, 
       caption:$caption, 
       hash:hash, 
       gallery:this, 
       index:position 
      }; 

지금 전체에 새 경로/w 링크를 변경하는 갤러리에게 -size 갤러리 이미지 :

  // Construct new hidden span for the image 
      var newSlide = this.$imageContainer 
       .append('<span class="image-wrapper current"><a class="advance-link" rel="history" href="/project/'+imageData.projectPath+'" title="'+imageData.title+'">&nbsp;</a></span>') 
       .find('span.current').css('opacity', '0'); 

그리고 사용자는 단지 이미지를 배치 정상적인 링크를 사용할 수 있도록, 여기에 갤러리 클릭 동작을 주석 :

,
     newSlide.find('a') 
       .append(imageData.image) 
       //.click(function(e) { 
        //gallery.clickHandler(e, this); 
       //}) 
       ; 
+0

당신에게 너무 감사 /prestondentalgroup.com.au/, 나는이 시도하고 당신은 내가에 도착하는 방법을 알려 드릴 것입니다 – user374557

+0

감사합니다,이입니다. 매우 도움이되고 효과적입니다. –

+0

나 역시 도움이됩니다. :) –

0

예 - at http://prestondentalgroup.com.au/downloads.html 슬라이드 이미지의 하이퍼 링크를 통해 뷰어에서 PDF 문서를 열고 저장할 수 있습니다. 잘 작동합니다 (예 : example_path를 작성하고/project /를 하위 폴더를 포함하여 PDF 파일의 URL로 대체 한 후 ).이 사이트의 images/downloads/폴더에서 readme.pdf로 링크하려면 example_path가됩니다. /downloads/readme.pdf
및 /프로젝트/HTTP된다 :