나는 당신의 "파이어 폭스 firstload 수정"에 대한 몇 가지 질문이 있습니다. 약간 변경된 코드를 사용하여 jquery flexslider와 관련하여 위에서 설명한 Firefox 오류를 제거합니다.
$(window).load(function() {
$('.flexslider').flexslider({
animation: "fade", //String: Select your animation type, "fade" or "slide"
slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
slideshow: true, //Boolean: Animate slider automatically
slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds
animationDuration: 1500, //Integer: Set the speed of animations, in milliseconds
directionNav: false, //Boolean: Create navigation for previous/next navigation? (true/false)
controlNav: false, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
controlsContainer: ".flex-container"
});
});
$(document).ready(function(){
$('img').load(function() {
$(this).each(function() {
/*alert("each func");*/
/*$(this).animate({opacity : 1.0}, 1000);*/
});
}).each(function() {
if(this.complete) {
//var src = $(this).attr("src");
//alert(src);
$(this).trigger("load");
};
});
});
- 나는 flexslider의 설정 이후에 넣어. 이게 정확하고/좋은가?
- 나는 그것이 어떻게 작동하는지 모르겠다. 이미지가 브라우저 캐시에서 나오면로드 이벤트가 발생하지 않는다고 설명합니다. 그런데 "$ ('img') .load (function() ')이 해고당하는 이유를 묻는다면 이미지가 캐시에서 가져 왔기 때문에 이벤트가 발생하지 않을 때'img ' 내가 해고되지 않기 때문에 .load 다른 단어 :..? 이미지가 캐시에서 올 때 어떻게되는지 설명해주십시오은 무엇 코드 나 이벤트 "영역"에
UPDATE 실패 : www.ozeankreuzer.de를 ?. 아직도 무엇이 잘못 되었나요 매일 첫 번째로드에 실패 오류는 다음과 같습니다는 document.body가 정의되어 있지 않습니다!. https://dl.dropbox.com/u/31225678/Screenshot%20-%2014.06.2012%20%2C%2003_12_28.png
작품을 마법처럼 난 당신이 jQuery를에 그런 체인은 설명시겠습니까 수 몰랐다 각 함수의 마지막 (function() 호출 로드 기능의 끝이 작동 중입니까? 감사합니다. – mattelliottIT
@mattelliottIT - 마지막'.each'는 각 이미지를 반복하면서'.complete' 속성이 설정되어 있는지 확인합니다. 그렇다면'.load' 이벤트를 수동으로 해제합니다. 일반적으로 이미지가'.complete' 일 때'.load' 이벤트가 발생하지 않으므로 이미지가 완료되었는지 수동으로 확인하고 그에 따라로드 이벤트를 트리거합니다. 이미지 중 하나가 이미 브라우저에 의해 캐시되고 onload 이벤트가 트리거되지 않고 즉시 캐시에서 페치 (fetch)된다고 상상해보십시오. 귀하의'.load' 이벤트 핸들러는 작동하지 않으므로 페이지가 예상대로 작동하지 않습니다. :) – karim79
아아. 시간을내어 설명해 주셔서 감사합니다. – mattelliottIT