2009-06-03 3 views
5

jQuery PrettyPhoto를 사용하고 있는데 id 변수를 통과하지 못하는 이유가 있습니다. 누군가이 문제를 앞두고 해결책을 알고 있다면 환상적 일 것입니다. 여기에 코드입니다 : 여기 jQuery PrettyPhoto ID를 iframe에 전달하는 중

<a href="/store-item-details?id=5&iframe=true&width=800&height=530" 
    rel="prettyPhoto[iframes]" 
    title=""> 
    <img src="/images/store/thumbs/'.$item->image.'" 
     alt="'.$item->name.'" 
     width="100" 
     border="0" /> 
</a> 

링크의

http://www.photographicpassions.com/shop?view=products&category=1

을 (예쁜 사진과 함께이 축소판 중 하나를 클릭) 여기에 태그에서 직접 링크입니다 :

http://www.photographicpassions.com/store-item-details?id=1&iframe=true&width=800&height=530

도와주세요! :)

답변

5

당신이 그것을 해킹하지 않으려면 버그를 해결 prettyPhoto의 새 버전을 출시했습니다 (http://fmarcia.info/jsmin/test.html을 당신은 아마 다시 작게하다를 위해 나중에 참조 할 것). 프로젝트 페이지 밖으로

확인 : 난 아직도 prettyPhoto 문제가 있습니다 .. (그리고 IE)가 여기 봐하지만 나에게 알려 주셔서 http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/

+0

감사합니다 - http://stackoverflow.com/questions/968954/jquery-prettyphoto-ie-issues – SoulieBaby

6

문제는 prettyPhoto 자체에 있습니다. 플러그인은 iframe의 경우 해당 URL에 다른 중요한 매개 변수가 없다고 가정하고 높이와 너비를 파싱 한 후 모든 매개 변수를 제거합니다.

다음은 jquery.prettyPhoto.js의 비공식 버전의 스 니펫입니다. Movie_url에서 물음표 뒤에 나오는 모든 것을 삭제하는 세 번째 줄을 확인하십시오.

}else if(pp_type == 'iframe'){ 
     movie_url = $caller.attr('href'); 
     movie_url = movie_url.substr(0,movie_url.indexOf('?')); 

     pp_typeMarkup = '<iframe src ="'+movie_url+'" width="'+(correctSizes['width']-10)+'" height="'+(correctSizes['height']-10)+'" frameborder="no"></iframe>'; 
    } 

당신이 얼마나 대담한 지 잘 모르겠지만 세 번째 줄을 주석으로 처리하면 효과가 있습니다.

}else if(pp_type == 'iframe'){ 
     movie_url = $caller.attr('href'); 
     // movie_url = movie_url.substr(0,movie_url.indexOf('?')); // commented out to allow other attributes to be passed along. 

     pp_typeMarkup = '<iframe src ="'+movie_url+'" width="'+(correctSizes['width']-10)+'" height="'+(correctSizes['height']-10)+'" frameborder="no"></iframe>'; 
    } 
관련 문제