Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1090 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Javascript

Thread title: Javascript
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
04-01-2006, 11:36 PM
#1
Garrett is offline Garrett
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
 
Posts: 2,694
iTrader: 11 / 100%
 

Garrett is on a distinguished road

Send a message via MSN to Garrett

  Old  Javascript

I know how to make a getElementById(); but is it possible to maby use something like:
function delayPage(){
delay code for x seconds, with diplayed image
then loads another funtion for the div visibility?
So what im asking is, I need code to delay time with a image.
}

Thanks!

04-01-2006, 11:48 PM
#2
Joe is offline Joe
Status: Custom User Title
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 2,297
iTrader: 0 / 0%
 

Joe is on a distinguished road

  Old

I don't think you can use something like delayPage() to delay the code loading. Infact, I don't think you can actually delay the parsing of code to the browser using Javascript.

04-02-2006, 12:40 AM
#3
Jonny is offline Jonny
Status: Member
Join date: Feb 2005
Location: UK
Expertise:
Software:
 
Posts: 335
iTrader: 0 / 0%
 

Jonny is on a distinguished road

  Old

setTimeout maybe?

04-02-2006, 09:02 AM
#4
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Jonny gets the gold star! You can set an event to happen in the future using the setTimeout (or repeatedly, with setInterval) function.

Code:
// Alerts 'Hello World' after two seconds
window.setTimeout("alert('Hello World')", 2000)

04-03-2006, 06:53 PM
#5
Garrett is offline Garrett
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
 
Posts: 2,694
iTrader: 11 / 100%
 

Garrett is on a distinguished road

Send a message via MSN to Garrett

  Old

But could I do this to say like:
function delayPage(divName, delayTime){
window.setTimeout("document.getElementById(divName ).style.display = "block";", delayTime)
}

04-03-2006, 10:06 PM
#6
Jonny is offline Jonny
Status: Member
Join date: Feb 2005
Location: UK
Expertise:
Software:
 
Posts: 335
iTrader: 0 / 0%
 

Jonny is on a distinguished road

  Old

Sure, try this:

HTML Code:
function delayPage(divName, delayTime){
window.setTimeout( 

  function() {
      document.getElementById(divName).style.display = "block"
  }

 , delayTime)

}

04-03-2006, 11:35 PM
#7
Garrett is offline Garrett
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
 
Posts: 2,694
iTrader: 11 / 100%
 

Garrett is on a distinguished road

Send a message via MSN to Garrett

  Old

If I may ask, what does the function() do? Why cant you leave the document.getElementById(divName).style.display = "block"?

04-04-2006, 10:38 PM
#8
Bas is offline Bas
Status: I love this place
Join date: Jan 2005
Location: The Netherlands
Expertise: Frontend, vBulletin
Software: Coda, Photoshop
 
Posts: 607
iTrader: -1 / 0%
 

Bas is on a distinguished road

Send a message via MSN to Bas

  Old

Originally Posted by Garrett
Why cant you leave the document.getElementById(divName).style.display = "block"?
That's the code that makes the part you selected, visible.

04-05-2006, 02:22 AM
#9
Garrett is offline Garrett
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
 
Posts: 2,694
iTrader: 11 / 100%
 

Garrett is on a distinguished road

Send a message via MSN to Garrett

  Old

But I didnt get why he used a function(){}

04-05-2006, 05:42 PM
#10
Jonny is offline Jonny
Status: Member
Join date: Feb 2005
Location: UK
Expertise:
Software:
 
Posts: 335
iTrader: 0 / 0%
 

Jonny is on a distinguished road

  Old

Because it asks for a function in the specification obviously.

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed