맛집 여행 캠핑 일상 생활

jQuery iframe 안에서 $(window).scroll 이 안 먹힐때 본문

jQuery

jQuery iframe 안에서 $(window).scroll 이 안 먹힐때

영은파더♥ 2016. 5. 30. 11:00

jQuery iframe 안에서 $(window).scroll 이 안 먹힐때



$(window).scroll 이 안되는 경우는 아마도 iframe 내에서 콘트롤 하려고 할때 실행이 되지 않을 것이다.


이럴때는 window.parent 를 넣어주면 된다.


$(document).ready(function(){

$(window.parent).scroll(function(){

alert($(window.parent).scrollTop());

});

});



Trackback : | Comments :