게시물이 iframe에로드되는 Wordpress 사이트가 있습니다.iframe 내부에서 iframe을 닫는 방법?
<a class="trick" rel="<?php the_permalink() ?>" href="<?php the_permalink() ?>"><?php the_title(); ?></a>
$ (문서) .ready (함수() {
$.ajaxSetup({cache:false}); $(".trick").click(function(){ var post_link = $(this).attr("rel"); $("#frame").css("display","block"); $("#frame").attr("url", post_link); $("body").css("overflow","hidden"); }); }); </script>
<iframe id="frame" frameborder="no" allowtransparency="true" width="100%" height="100%" scrolling="no" src=""></iframe>
을 자,이로드를 닫는 방법 :
이
작동 코드입니다 iframe 내부의 iframe?메인 페이지는 index.php (메인 워드 프레스 루프)이고 iframe의 내용은 머리글과 바닥 글이없는 single.php (단일 게시물)입니다.
감사합니다.
이 내가
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("#close").click(function(){
$('#frame', window.parent.document).remove();
});
});
</script>
</head>
<body>
<div id="container-single">
<button id="close" >Close</button>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article <?php post_class('single') ?> id="post-<?php the_ID(); ?>">
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages(array('before' => 'Pages: ', 'next_or_number' => 'number')); ?>
<?php the_tags('Tags: ', ', ', ''); ?>
<?php include (TEMPLATEPATH . '/_/inc/meta.php'); ?>
</div>
</article>
<?php endwhile; endif; ?>
</div>
</body>
Iframe을 닫으시겠습니까? 무슨 소리 야? 내부 iframe 또는 무엇을 제거 하시겠습니까? –
[iframe 내에서 iframe을 닫는 방법] 가능한 복제본 (http://stackoverflow.com/questions/6754935/how-to-close-an-iframe-within-iframe-itself) –