나는이 웹 사이트의 대부분에서 여전히 초보자이지만 웹 사이트를로드하기 전에 div를 생성하고 div를 생성 한 다음 웹 사이트를로드하려고합니다. 여기에 내 코드를 순환 이하 올바른 DIV 얻을 :프리 로더 문제
$(function() {
$('#splash-holder').delay(6000).toggle('#splash-main');
var counter = 0,
divs = $('#splash-one, #splash-two, #splash-three, #splash-five');
function showDiv() {
divs.hide() // hide all divs
.filter(function (index) { return index == counter % 3; }) // figure out correct div to show
.fadeIn('fast'); // and show it
counter++;
}; // function to loop through divs and show correct div
showDiv(); // show first div
setInterval(function() {
showDiv(); // show next div
}, 13 * 180); // do this every 10 seconds
});
가 그럼 난이 프리 로더 스크립트를 사용을 :
여기$(window).load(function() {
$('#preloader').delay(6000);
$('#preloader').fadeTo('fast', 0.1 , function() {
$('body').css('overflow','visible');
$(this).remove();
});
});
내 코드입니다 :
<div id="preloader">
<div id="spinner_container">
<div id="splash-holder">
<div id="splash-title" class="hFont">We <img src="<?php bloginfo('template_directory'); ?>/images/logo-c.png" /></div>
<div id="splash-one" class="hFont">conversations not messages.</div>
<div id="splash-two" class="hFont">bridges not silos.</div>
<div id="splash-three" class="hFont">things differently.</div>
</div><!-- #splash-holder -->
</div><!-- #spinner-container -->
</div><!-- #preloader -->
이 작동, 그러나 이것을 코딩하는 더 깨끗한 방법이 있는지 궁금해하고있었습니다.
이것은 PHP보다 js 태그에서 더 적합 할 것입니다. 그리고 대답으로 : 먼저 웹 사이트 (브라우저 법)를로드 한 다음 나머지 페이지가 숨겨져있는 동안 div를 수정해야합니다. – khael
PHP 태그가 제거되었습니다. 이 질문에 PHP가 없습니다. – ceejayoz
내가하려는 일을 성취하는 가장 좋은 방법은 무엇일까요? 어떤 도움이라도 대단히 감사하겠습니다. 나는 Khael이 페이지의 나머지가 숨겨져있는 동안 웹 사이트를로드 한 다음 div를 수정한다고 말한 것을 알고있다. 누군가가 나를 도와 줄 수 있습니까? – Outlawsessy