Live Brilliant

[jquery] iframe에서 부모 접근 컨트롤 본문

개발은 핵찜이야/JQUERY

[jquery] iframe에서 부모 접근 컨트롤

주인정 2013. 12. 30. 12:08

1. 아이프레임에서 부모창에 .background_layer 활성화

$('.background_layer', parent.document).show();


2. 아이프렘이에서 부모창의 다른 아이프레임 컨트롤

$("#id", parent.frames['frameid'].document);


3. iframe 부모창의 높이값 구하기

$(parent.window).height(); //브라우저의 뷰포트의 높이 반환

$(parent.document).height(); //HTML의 높이를 반환


4. 부모창 스크롤바 이동


var position=$("#pre_userdb",parent.document).offset();   

$('html, body', window.parent.document).animate({scrollTop:position.top}, 'slow');

Comments