Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Problem with script
- From: javascript@xxxxxxxxxx (::OurNorth.ca::)
- Subject: [Javascript] Problem with script
- Date: Mon, 18 Feb 2002 13:02:30 -0600
This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C1B87C.861D30C0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
I copied a script from DynamicDrive.com, which offers lots of free, =
great DHTML scripts. I found a script for a splash page (given below) =
thinking, apparently wrongly, that I could use this to have a brief =
message appear, while two images downloaded for the first page of the =
actual website.
For some reason, no matter how I try and fill in the array...nothing =
downloads until all the messaging is finished which really defeats the =
purpose of the whole thing.
Can anybody help here? (I am on digest so cc my email address if you =
can help)
code follows as copied from DirectDrive=20
<html>
<head>
<title>Intro Screen...</title>
</head>
<body bgcolor=3D"#000000" text=3D"#FFFFFF">
<div id=3D"splashcontainer" =
style=3D"position:absolute;width:350px;"></div>
<layer id=3D"splashcontainerns" width=3D450></layer>
<script>
//Specify the paths of the images to be used in the splash screen, if =
any.
//If none, empty out array (ie: preloadimages=3Dnew Array())
var preloadimages=3Dnew =
Array("http://abstract.simplenet.com/point.gif","http://abstract.simplene=
t.com/point2.gif")
//configure delay in miliseconds between each message (default: 2 =
seconds)
var intervals=3D2000
//configure destination URL
var =
targetdestination=3D"http://www.dynamicdrive.com/dynamicindex3/dynamicspl=
ash.htm"
//configure messages to be displayed
//If message contains apostrophe('), backslash them (ie: "I\'m fine")
var splashmessage=3Dnew Array()
var openingtags=3D'<font face=3D"Arial" size=3D"4">'
splashmessage[0]=3D'<img =
src=3D"http://abstract.simplenet.com/point.gif"> Welcome to Dynamic =
Drive <img src=3D"http://abstract.simplenet.com/point2.gif">'
splashmessage[1]=3D'The premier place on the net for free DHTML scripts'
splashmessage[2]=3D'All scripts on this site take advantage of the =
latest in JavaScript/ DHTML technology'
splashmessage[3]=3D'With emphasis on practicality and backwards =
compatibility'
splashmessage[4]=3D'To bring true power and interactivity to your site.'
splashmessage[5]=3D'Please stand by...'
var closingtags=3D'</font>'
//Do not edit below this line (besides HTML code at the very bottom)
var i=3D0
var ns4=3Ddocument.layers?1:0
var ie4=3Ddocument.all?1:0
var ns6=3Ddocument.getElementById&&!document.all?1:0
var theimages=3Dnew Array()
//preload images
if (document.images){
for (p=3D0;p<preloadimages.length;p++){
theimages[p]=3Dnew Image()
theimages[p].src=3Dpreloadimages[p]
}
}
function displaysplash(){
if (i<splashmessage.length){
sc_cross.style.visibility=3D"hidden"
sc_cross.innerHTML=3D'<b><center>'+openingtags+splashmessage[i]+closingta=
gs+'</center></b>'
sc_cross.style.left=3Dns6?parseInt(window.pageXOffset)+parseInt(window.in=
nerWidth)/2-parseInt(sc_cross.style.width)/2 : =
document.body.scrollLeft+document.body.clientWidth/2-parseInt(sc_cross.st=
yle.width)/2
sc_cross.style.top=3Dns6?parseInt(window.pageYOffset)+parseInt(window.inn=
erHeight)/2-sc_cross.offsetHeight/2 : =
document.body.scrollTop+document.body.clientHeight/2-sc_cross.offsetHeigh=
t/2
sc_cross.style.visibility=3D"visible"
i++
}
else{
window.location=3Dtargetdestination
return
}
setTimeout("displaysplash()",intervals)
}
function displaysplash_ns(){
if (i<splashmessage.length){
sc_ns.visibility=3D"hide"
sc_ns.document.write('<b>'+openingtags+splashmessage[i]+closingtags+'</b>=
')
sc_ns.document.close()
sc_ns.left=3DpageXOffset+window.innerWidth/2-sc_ns.document.width/2
sc_ns.top=3DpageYOffset+window.innerHeight/2-sc_ns.document.height/2
sc_ns.visibility=3D"show"
i++
}
else{
window.location=3Dtargetdestination
return
}
setTimeout("displaysplash_ns()",intervals)
}
function positionsplashcontainer(){
if (ie4||ns6){
sc_cross=3Dns6?document.getElementById("splashcontainer"):document.all.sp=
lashcontainer
displaysplash()
}
else if (ns4){
sc_ns=3Ddocument.splashcontainerns
sc_ns.visibility=3D"show"
displaysplash_ns()
}
else
window.location=3Dtargetdestination
}
window.onload=3Dpositionsplashcontainer
</script>
<!--Set href in below link to the URL of the target destination-->
<div align=3D"right">
<table border=3D"0" width=3D"200" height=3D"100%" cellspacing=3D"0" =
cellpadding=3D"0">
<td width=3D"100%" valign=3D"bottom" align=3D"right">
[ <a =
href=3D"http://www.dynamicdrive.com/dynamicindex3/dynamicsplash.htm"><fon=
t color=3D"#FFFFFF">Skip Intro</font></a> ]
</td>
</table>
</div>
</body>
</html>
Pauline (who is usually scared to death to post on these things!)
visit us at our new domain
http://www.ournorth.ca
=20
------=_NextPart_000_000A_01C1B87C.861D30C0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2713.1100" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>I copied a script from =
DynamicDrive.com, which=20
offers lots of free, great DHTML scripts. I found a script for a =
splash=20
page (given below) thinking, apparently wrongly, that I could use this =
to have a=20
brief message appear, while two images downloaded for the first page of =
the=20
actual website.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>For some reason, no matter how I try =
and fill in=20
the array...nothing downloads until all the messaging is finished which =
really=20
defeats the purpose of the whole thing.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>Can anybody help here? (I am on =
digest so=20
cc my email address if you can help)</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>code follows as copied from =
DirectDrive=20
</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2><html></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DVerdana size=3D2><head><BR><title>Intro=20
Screen...</title><BR></head></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DVerdana size=3D2><body bgcolor=3D"#000000"=20
text=3D"#FFFFFF"></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DVerdana size=3D2><div id=3D"splashcontainer"=20
style=3D"position:absolute;width:350px;"></div></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DVerdana size=3D2><layer id=3D"splashcontainerns"=20
width=3D450></layer></FONT></DIV>
<DIV> </DIV><FONT face=3DVerdana size=3D2>
<DIV><BR><script></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>//Specify the paths of the images to be used in the splash screen, =
if=20
any.<BR>//If none, empty out array (ie: preloadimages=3Dnew =
Array())<BR>var=20
preloadimages=3Dnew Array("<A=20
href=3D'http://abstract.simplenet.com/point.gif","http://abstract.simplen=
et.com/point2.gif'>http://abstract.simplenet.com/point.gif","http://abstr=
act.simplenet.com/point2.gif</A>")<BR>//configure=20
delay in miliseconds between each message (default: 2 seconds)<BR>var=20
intervals=3D2000<BR>//configure destination URL<BR>var =
targetdestination=3D"<A=20
href=3D"http://www.dynamicdrive.com/dynamicindex3/dynamicsplash.htm">http=
://www.dynamicdrive.com/dynamicindex3/dynamicsplash.htm</A>"</DIV>
<DIV> </DIV>
<DIV>//configure messages to be displayed<BR>//If message contains=20
apostrophe('), backslash them (ie: "I\'m fine")</DIV>
<DIV> </DIV>
<DIV>var splashmessage=3Dnew Array()<BR>var openingtags=3D'<font =
face=3D"Arial"=20
size=3D"4">'<BR>splashmessage[0]=3D'<img src=3D"<A=20
href=3D"http://abstract.simplenet.com/point.gif">http://abstract.simplene=
t.com/point.gif</A>">=20
Welcome to Dynamic Drive <img src=3D"<A=20
href=3D"http://abstract.simplenet.com/point2.gif">'">http://abstract=
.simplenet.com/point2.gif">'</A><BR>splashmessage[1]=3D'The=20
premier place on the net for free DHTML =
scripts'<BR>splashmessage[2]=3D'All=20
scripts on this site take advantage of the latest in JavaScript/ DHTML=20
technology'<BR>splashmessage[3]=3D'With emphasis on practicality and =
backwards=20
compatibility'<BR>splashmessage[4]=3D'To bring true power and =
interactivity to=20
your site.'<BR>splashmessage[5]=3D'Please stand by...'<BR>var=20
closingtags=3D'</font>'</DIV>
<DIV> </DIV>
<DIV>//Do not edit below this line (besides HTML code at the very =
bottom)</DIV>
<DIV> </DIV>
<DIV>var i=3D0</DIV>
<DIV> </DIV>
<DIV>var ns4=3Ddocument.layers?1:0<BR>var ie4=3Ddocument.all?1:0<BR>var=20
ns6=3Ddocument.getElementById&&!document.all?1:0<BR>var =
theimages=3Dnew=20
Array()</DIV>
<DIV> </DIV>
<DIV>//preload images<BR>if (document.images){<BR>for=20
(p=3D0;p<preloadimages.length;p++){<BR>theimages[p]=3Dnew=20
Image()<BR>theimages[p].src=3Dpreloadimages[p]<BR>}<BR>}</DIV>
<DIV> </DIV>
<DIV>function displaysplash(){<BR>if=20
(i<splashmessage.length){<BR>sc_cross.style.visibility=3D"hidden"<BR>s=
c_cross.innerHTML=3D'<b><center>'+openingtags+splashmessage[i=
]+closingtags+'</center></b>'<BR>sc_cross.style.left=3Dns6?pa=
rseInt(window.pageXOffset)+parseInt(window.innerWidth)/2-parseInt(sc_cros=
s.style.width)/2=20
:=20
document.body.scrollLeft+document.body.clientWidth/2-parseInt(sc_cross.st=
yle.width)/2<BR>sc_cross.style.top=3Dns6?parseInt(window.pageYOffset)+par=
seInt(window.innerHeight)/2-sc_cross.offsetHeight/2=20
:=20
document.body.scrollTop+document.body.clientHeight/2-sc_cross.offsetHeigh=
t/2<BR>sc_cross.style.visibility=3D"visible"<BR>i++<BR>}<BR>else{<BR>wind=
ow.location=3Dtargetdestination<BR>return<BR>}<BR>setTimeout("displayspla=
sh()",intervals)<BR>}</DIV>
<DIV> </DIV>
<DIV>function displaysplash_ns(){<BR>if=20
(i<splashmessage.length){<BR>sc_ns.visibility=3D"hide"<BR>sc_ns.docume=
nt.write('<b>'+openingtags+splashmessage[i]+closingtags+'</b>=
')<BR>sc_ns.document.close()</DIV>
<DIV> </DIV>
<DIV>sc_ns.left=3DpageXOffset+window.innerWidth/2-sc_ns.document.width/2<=
BR>sc_ns.top=3DpageYOffset+window.innerHeight/2-sc_ns.document.height/2</=
DIV>
<DIV> </DIV>
<DIV>sc_ns.visibility=3D"show"<BR>i++<BR>}<BR>else{<BR>window.location=3D=
targetdestination<BR>return<BR>}<BR>setTimeout("displaysplash_ns()",inter=
vals)<BR>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>function positionsplashcontainer(){<BR>if=20
(ie4||ns6){<BR>sc_cross=3Dns6?document.getElementById("splashcontainer"):=
document.all.splashcontainer<BR>displaysplash()<BR>}<BR>else=20
if=20
(ns4){<BR>sc_ns=3Ddocument.splashcontainerns<BR>sc_ns.visibility=3D"show"=
<BR>displaysplash_ns()<BR>}<BR>else<BR>window.location=3Dtargetdestinatio=
n<BR>}<BR>window.onload=3Dpositionsplashcontainer</DIV>
<DIV> </DIV>
<DIV></script></DIV>
<DIV> </DIV>
<DIV><!--Set href in below link to the URL of the target=20
destination--></DIV>
<DIV> </DIV>
<DIV><div align=3D"right"><BR><table border=3D"0" width=3D"200" =
height=3D"100%"=20
cellspacing=3D"0" cellpadding=3D"0"><BR><td width=3D"100%" =
valign=3D"bottom"=20
align=3D"right"><BR>[ <a href=3D"<A=20
href=3D'http://www.dynamicdrive.com/dynamicindex3/dynamicsplash.htm"><fon=
t'>http://www.dynamicdrive.com/dynamicindex3/dynamicsplash.htm"><fo=
nt</A>=20
color=3D"#FFFFFF">Skip Intro</font></a>=20
]<BR></td><BR></table><BR></div></DIV>
<DIV> </DIV>
<DIV><BR></body><BR></html></DIV>
<DIV> </DIV>
<DIV>Pauline (who is usually scared to death to post on these=20
things!)</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>visit us at our new domain<BR><A=20
href=3D"http://www.ournorth.ca">http://www.ournorth.ca</A><BR> </FON=
T></DIV></BODY></HTML>
------=_NextPart_000_000A_01C1B87C.861D30C0--
- Prev by Date: [Javascript] JavaScript List Unsubscirbe, Subscribe & Posting Info.
- Next by Date: [Javascript] Javascript/JScript & ASP
- Previous by thread: [Javascript] JavaScript List Unsubscirbe, Subscribe & Posting Info.
- Next by thread: [Javascript] Javascript/JScript & ASP
- Index(es):