아래와 같이 multipart / form-data 양식을 제출하고 있습니다. 여기 양식은 iframe을 대상으로합니다.
<form id="upp" method="post" action="sample.jsp" name="upform" enctype="multipart/form-data" target="my_iframe">
<input type="hidden" name="todo" value="upload">
<input id="haa" type="file" name="uploadfile" size="50">
</form>
<iframe id="my" name="my_iframe" scrolling="no" src="sample.jsp" frameBorder="0">
</iframe>
그리고 내가 사용한 스크립트는
$('#haa').change(function() {
$('#upp').submit();
});
이제 파일이 iframe에 업로드되는 동안 로딩 이미지 (.gif)를 어떻게 넣을 수 있습니까?
데모가있는 솔루션은 다음과 같습니다. http://www.itgeared.com/articles/1508-display-gif-loading-iframe-jquery/
활성화해야 할 것은 기본적으로 다음과 같은 자바 스크립트입니다.
<script>
$(document).ready(function () {
$('#iframe1').on('load', function () {
$('#loader1').hide();
});
});
콘텐츠가로드 된 후 숨겨지는 일부 CSS :
#loader1 {
position:absolute;
background:#ffffff;
}
배경색을 url (image ...)로 바꿀 수 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다