/    Sign up×
Community /Pin to ProfileBookmark

Back again . . .

I’ve solved my pesky little “timed link” problem from a while back with a DHTML script. It’s basically a text slide show that jumps to a specified URL after the last line is displayed. A pretty nifty script all in all. You can even adjust the timing and play with the fonts a bit. Anyway . . . It seems to work perfectly except that there is a fairly large space between the text and the ad banner that displays above it. This causes the image slideshow below the text to display below the bottom of the browsers initial field of vision. Visitors would have to scroll down to see the image show. Since the content of the text and images are tied together (as far as subject matter) this creates a small problem. So I was wondering if there might be a way to position the text slideshow further up on the page. I was also curious about the onload tag at the end of the script. Does this need to be moved up into my initial BODY tag with the rest of my onload events? It doesn’t seem to be causing a problem, but perhaps it should be done for the sake of form. Here’s a link to my site, and below that the script itself. On the page the script begins just after the BODY tag (i.e. BODY, bg, font & link attributes, and onload events) . . .

[URL=http://www.angelfire.com/rock/tillhell]My site . . .[/URL]

[B]The script . . .[/B]

<div id=”splashcontainer” style=”position:absolute;width:350″></div>

<layer id=”splashcontainerns” width=450></layer>

<script>

//configure delay in miliseconds between each message (default: 2 seconds)
var intervals=4000
//configure destination URL
var targetdestination=”http://www.angelfire.com/rock/tillhell/titlepage/titlepage.html

//configure messages to be displayed
var splashmessage=new Array()
var openingtags='<font color=”#666666″ size=”5″>’
splashmessage[0]=”<I>From the creative minds of . . .</I>”
splashmessage[1]=”<B>Dr. Samual J. Robertson II,<BR> <I>Practitioner of Reality . . .</I></B>”
splashmessage[2]=”<I>and . . .</I>”
splashmessage[3]=”<B>~Maxx . . .</B>”
var closingtags='</font>’

//Do not edit below this line

var i=0

function displaysplash_ie(){
if (i<splashmessage.length){
sc_ie.style.visibility=”hidden”
sc_ie.innerHTML='<b><center>’+openingtags+splashmessage[i]+closingtags+'</center></b>’
sc_ie.style.top=document.body.scrollTop+document.body.clientHeight/2-sc_ie.offsetHeight/2
sc_ie.style.visibility=”visible”
i++
}
else{
window.location=targetdestination
return
}
setTimeout(“displaysplash_ie()”,intervals)
}

function displaysplash_ns(){
if (i<splashmessage.length){
sc_ns.visibility=”hide”
sc_ns.document.write(‘<b>’+openingtags+splashmessage[i]+closingtags+'</b>’)
sc_ns.document.close()

sc_ns.left=pageXOffset+window.innerWidth/2-sc_ns.document.width/2
sc_ns.top=pageYOffset+window.innerHeight/2-sc_ns.document.height/2

sc_ns.visibility=”show”
i++
}
else{
window.location=targetdestination
return
}
setTimeout(“displaysplash_ns()”,intervals)
}

function positionsplashcontainer(){
if (document.all){
sc_ie=document.all.splashcontainer
sc_ie.style.left=document.body.scrollLeft+document.body.clientWidth/2-sc_ie.offsetWidth/2
sc_ie.style.top=document.body.scrollTop+document.body.clientHeight/2-sc_ie.offsetHeight/2
displaysplash_ie()
}
else if (document.layers){
sc_ns=document.splashcontainerns
sc_ns.left=pageXOffset+window.innerWidth/2-sc_ns.document.width/2
sc_ns.top=pageYOffset+window.innerHeight/2-sc_ns.document.height/2
sc_ns.visibility=”show”
displaysplash_ns()
}
else
window.location=targetdestination
}
window.onload=positionsplashcontainer

</script>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@DrDaMourApr 23.2003 — if you are talking about the java applett right in teh middle of the first page being down to far, then that's becuase of html:

you have


<BR><BR>

<BR><BR>

<BR><BR>

<CENTER>

<applet code="burnshow.class"

archive="burnshow.jar"

width=528

height=269>


which puts 6 line breaks before the applet, which would push it donw quite a bit...
Copy linkTweet thisAlerts:
@MaxxauthorApr 23.2003 — You'd think that that would do the job Doc (you don't mind if I call you 'Doc', do you?) But if I remove the line breaks the text slide show comes up [B]behind[/B] the applet. Very strange, I thought. But not too suprising given the nature of applets. Any other ideas anyone?
Copy linkTweet thisAlerts:
@DrDaMourApr 24.2003 — what video mode are you in, cause i'm in 1027.768 and there is no text scrolling anywhere that i can see, other than the window.status bar. I think other people are having the smae problem trying to understand what you're tlaking about
×

Success!

Help @Maxx spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...