2010-02-01 2 views
0

이 문제는 이전에 논의 된 적이 있지만 잘 작동하지 않는 것으로 알고 있습니다. 해당 페이지의 iframe이있는 마스터 html 페이지가 있습니다. jquery prettyphoto를 사용하고 iframe에서 링크를 클릭 할 때 부모 윈도우에 라이트 박스를 표시하는 방법을 궁금합니다.iframe에서 jquery prettyPhoto 라이트 박스를 iframe에서 가져 오기

하십시오 아래에있는 내 코드 :

마스터 페이지

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Master Page</title> 
</head> 

<body> 
<iframe src="iframe.html" width="300" height="300px" frameborder="0"></iframe> 
</body> 
</html> 

iframe이 페이지 당신은에 prettyPhoto.js 소스를 편집 할 필요 해요

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>iframe</title> 

<style type="text/css" media="screen"> 
    @import url("assets/css/infotech-iframes.css"); 
    @import url("assets/css/infotech-popup.css"); 
</style> 

<script src="assets/js/jquery.js" type="text/javascript" charset="utf-8"></script> 
<script src="assets/js/jquery.popup.js" type="text/javascript" charset="utf-8"></script> 

</head> 

<body> 
    <a href="assets/images/screenshots/campaign-setup-lg.png" rel="prettyPhoto[gallery]"><img src="assets/images/screenshots/campaign-setup-sm.gif" /></a> 
<script type="text/javascript" charset="utf-8"> 
    $(document).ready(function(){ 
     $("a[rel^='prettyPhoto']").prettyPhoto(); 
    }); 
</script> 
</body> 
</html> 

감사

답변

0

모든 것을 상위 프레임으로 밀어 넣습니다. 내가

appendTo($('body', window.parent)) 
+0

안녕처럼 뭔가

appendTo($('body')) 

에 대한 참조를 수정하여 시작하는 것, 은 당신의 제안을 시도하지만 여전히 iframe이 아닌 부모 창 내에서 표시하는 라이트 박스 같은 결과를 얻을. 탁신 – Kurt

관련 문제