Click to See Complete Forum and Search --> : Back again . . .


Maxx
04-23-2003, 12:10 PM
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) . . .


My site . . . (http://www.angelfire.com/rock/tillhell)

The script . . .

<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>

DrDaMour
04-23-2003, 02:05 PM
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...

Maxx
04-23-2003, 03:18 PM
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 behind the applet. Very strange, I thought. But not too suprising given the nature of applets. Any other ideas anyone?

DrDaMour
04-23-2003, 07:51 PM
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