English 中文(简体)
装载功能的舱位
原标题:jquery on load function

Question
I want to play a loader when any page is loading and it work stop when complete page is loaded. Any idea?

i am new in jquery or javascript.

最佳回答

紧接着,在你的网页上打上了DVD。 在您的网页上或外部文字档案的顶端贴上这一文字:

$( BODY ).append( <div id="loading"><img src="images/loading.gif" /></div> );

显然,在你想要的地方,你需要作风。 我们这样做,而不只是把它硬化为一页内容,这样,任何有 Java本残疾的人都会看到它。

之后,在填满时,便附上装载DIV的载荷。 在您网页底部或<代码>内贴上这一文字(文件)。

$(window).load(function() {
    $( #loading ).hide();
});
问题回答

你们需要倾听载荷的活动

window.onload = function() {
 // do something
}

$(window).load(function() {
      // do something
});

但是,在 j忙的情况下,最好使用:

$(document).ready(function() {
    // do something
});

你们可以使用麻省理工学院和麻省办法。

Demo:

rel=“nofollow” http://www.balam.in/ Person/triponetDemo/pre-loader.html

Click on view source to see the CSS and javascript. Have a div with id as loading and style the div to show the ajax spinner. Whenever an ajax method is triggered it will show the loading div and when the ajax request is completed, it hides the loading div.

请注意,你需要把装上你想要显示的网页。

如果你想向Ajax的pin子进行复读,情况就好了。

check the link below: http://www.balam.in/personal/triponetDemo/pre-loader-refresh.html

看到执行情况的观点来源

每次复课时,都会显示 a子的pin子,而当OM准备藏匿 a子的时候。





相关问题
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.

热门标签