본문 바로가기

워드프레스 그누보드에서 iframe 오토리사이즈방법??

이온디 2017.11.29 17:14 조회 448 댓글 0
목록

http://gnu.kilho.net/bbs/board.php?bo_table=qna&wr_id=10573


동일한 도메인인 경우에는 iframe 리사이징이 가능합니다.

워드프레스에서 게시판 페이지에는 아래와 같이 사용하고 있으며
<iframe id="myframe" name="myframe" src="http://gnu.kilho.net/bbs/board.php?bo_table=qna" style="width:100%;height:550px" frameborder=0 scrolling=false></iframe>

아래는 길호넷에서 그누보드 tail.php 에서 사용중인 소스입니다.
<script>
document.domain = "kilho.net";

var top_url = top.location.href;
if((top_url.indexOf('kilho.net')<0)||(top_url.indexOf('gnu.kilho.net')>=0))
{
top_url = top_url.replace("http://gnu.kilho.net/bbs/board.php", "http://kilho.net/bbs/board.php"); 
document.write(top_url);

top.location.replace(top_url);
}


parent.document.getElementById("myframe").style.height = 0;
parent.document.getElementById("myframe").style.height = 100;

function addLoadEvent(func)
{
var oldonload = window.onload;
if(typeof window.onload != "function")
{
window.onload = func;
}else{
window.onload = function()
{
oldonload();
func();
}
}
}

function resize()
{
parent.document.getElementById("myframe").style.height = document.body.scrollHeight + 50 + "px";
parent.window.scrollTo(0,0);
}

addLoadEvent(resize);
</script>

댓글 0

아직 댓글이 없어요

이 글에 대한 생각을 가장 먼저 남겨보세요.

댓글을 작성하려면 로그인이 필요합니다.