English 中文(简体)
将Fade-In作为最初的负荷?
原标题:Execute Fade-In as Page initially loads?

我正在制订一些《酒吧法》,以应用页面转换。 哪一要求 j子法做,基本上适用页数如下:

$("body").css("display", "none");
$("body")().fadeIn(400); 

网页一旦上载重,然后指示电线有效,但我想发生的事情从一开始就对整个网页有效,并试图:

<代码>(文件){

然而,这并不奏效。 我也尝试了这一法典,但没有结果:

$("body").load().css("display", "none");
$("body").load().fadeIn(400);

我的法典区是否有任何明显错误,可加以纠正,以适用所期望的行为,或者社区能否向我发出指示,证明我所要做的工作得到正确执行?

问题回答

You could place this in a .css file -

body { display:none; }

甚至将其置于类似位置:

<body style="display:none;" >

然后以<代码>$(文件)ready()。 在使用这一系统方面遇到挫折:

$(document).ready(function(){
   $("body").fadeIn(400);
});

浏览器将首先根据<代码>cs文档提供超文本。 因此,当浏览器投放<代码><and'gt; tag时,该浏览器便可看到一种芯片规则,即其<代码> 显示<<>>> /代码>的财产必须贴上<代码>none。 仅在载重之后。 j 已完成($(document)ready()。 您可打电话到fadeIn();

You could use CSS to set the whole page to invisible or hidden:

body {
    display: none;
}

或:

body {
    visibility: hidden;
}

您可在<代码><head>内将此列为中线。 然后,在酒吧内,你可以装满一次。

//    $("body")().fadeIn(400); // this is incorrect, try with:
$( body ).fadeIn(400);

这意味着:

$("body").css("display", "none");

$(window).load(function(){  // use "window"
  $( body ).fadeIn(400);
});

或您可尝试直接从社保局(取决于您的需要)上设定<代码>:无;。

body{
  display:none;
}

你们应当使用窗户而不是OM。

Try :

   $(window).load(function(){

    $("body").css("display", "none");
    $("body").fadeIn(400);

})

http://blog.eizesus.com/2009/03/jquery-s-ready-runs- prior-load-event/“rel=“nofollow”>。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签