iframe 안에 있는 CSS를 변경하고싶습니다. 채택완료
Copy
$(document).ready(function(){ $('.iframe_row_div iframe').hover(function(){ $(this).parent().children('iframe').not(this).hide(); $(this).css('width', '100%'); $(this).contents().find('.sct_another_wrap2').attr('background', '#f4f4f4'); });});
이런식으로 소스를 짰습니다.
원래 아이프레임의 width값이 236px인데.. hover를 하면 width값이 100%가 되면서 아이프레임 안에있는 .sct_another_wrap2 라는 div의 배경색을 바꾸게 할려고 하고있습니다.
width값 부분은 매우 잘되는데, 안의 css를 수정할려고 하니 문제가 됩니다.
jquery-1.8.3.min.js:2 Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "현재 페이지 주소" from accessing a frame with origin "아이프레임 주소". Protocols, domains, and ports must match.
라는 오류가 뜨는데.. 원인과 해결 방법을 모르겠습니다;;
답변 1개
채택된 답변
+20 포인트
답변에 대한 댓글 3개
�
9년 전
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
그러면 값 전달도 되지 않는건가요? 값 전달로라도 해볼까 하는데..