Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My script quit working. Please Help.

Status
Not open for further replies.

jazzee

Technical User
Oct 29, 2000
33
US
Someone wrote this script for me a while ago. It worked fine untill a couple weeks ago. If you view the picture the script makes you'll notice that the first Sara Creations is too big.

Can anyone fix this? I emailed the guy who wrote it but he never got back to me. Here is the script:


<html>
<head>
<title>
Sara Creations
</title>

<style type=&quot;text/css&quot;>
<!--
span.v { font-weight:normal; visibility:hidden; position:relative; }
.sh { position:absolute; top:0; left:0; visibility:hidden; font-family:Arial Narrow, Sans-Serif; font-size:78px; }
-->
</style>
<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
<!--
// Browser detection
var ns4=((navigator.appName==&quot;Netscape&quot;)&&(document.layers))?1:0;
var ns6=((navigator.appName==&quot;Netscape&quot;)&&(document.getElementById))?1:0;
var ie4=(document.all)?1:0;
// wt = browser width, ht = browser height, st = timeout used later, mi = middle, sh = shadows showing
var wt, ht, st, mi, sh=0;
// Cross-browser variables
var vis = (ns4)?&quot;show&quot;:&quot;visible&quot;;
var hid = (ns4)?&quot;hide&quot;:&quot;hidden&quot;;
// Get everything in the right place
function measure()
{
if(ie4)
{
wt=document.body.clientWidth;
ht=document.body.clientHeight;
}
if(ns4||ns6)
{
wt=window.innerWidth;
ht=window.innerHeight;
}
var r = getObj(&quot;right_name&quot;), l = getObj(&quot;left_name&quot;);
r.left = wt-390; // Mess around with -390 if you use a different font / font size
r.top = parseInt(ht/2);
r.visibility = vis;
l.top = parseInt(ht/2);
l.visibility = vis;
mi = parseInt(wt/2)-200;
for(var i=2; i<16; i+=2)
{
var shadow_now = getObj(&quot;shadow_&quot;+(i/2));
shadow_now.top = parseInt(ht/2)+i+2;
shadow_now.left = mi+i+4;
}
}
// Global function for getting the objects (cross-browser)
function getObj(obj)
{
return ( (ie4) ? document.all[obj].style : (ns4) ? document.layers[obj] : (ns6)? document.getElementById(obj).style : false );
}
// Moves text to the centre
function move_one()
{
var l=getObj(&quot;left_name&quot;), r=getObj(&quot;right_name&quot;);
if(parseInt(l.left) < mi)
{
l.left = parseInt(l.left)+7;
r.left = parseInt(r.left)-7;
}
else
{
clearInterval(st);
st = setInterval(&quot;show_shadows()&quot;,100);
}
}
function show_shadows()
{
if(sh++ < 7)
{
getObj(&quot;shadow_&quot;+sh).visibility=vis;
}
else
{
clearInterval(st);
}
}
// -->
</script>
</head>



<body onload=&quot;measure(); st=setInterval('move_one()',10)&quot; scroll=&quot;no&quot;>
<div id=&quot;shadow_7&quot; class=&quot;sh&quot;>
<font color=&quot;yellow&quot;>
Sara Creations
</font>
</div>
<div id=&quot;shadow_6&quot; class=&quot;sh&quot;>
<font color=&quot;orange&quot;>
Sara Creations
</font>
</div>
<div id=&quot;shadow_5&quot; class=&quot;sh&quot;>
<font color=&quot;red&quot;>
Sara Creations
</font>
</div>
<div id=&quot;shadow_4&quot; class=&quot;sh&quot;>
<font color=&quot;violet&quot;>
Sara Creations
</font>
</div>
<div id=&quot;shadow_3&quot; class=&quot;sh&quot;>
<font color=&quot;navy&quot;>
Sara Creations
</font>
</div>
<div id=&quot;shadow_2&quot; class=&quot;sh&quot;>
<font color=&quot;indigo&quot;>
Sara Creations
</font>
</div>
<div id=&quot;shadow_1&quot; class=&quot;sh&quot;>
<font color=&quot;purple&quot;>
Sara Creations
</font>
</div>
<div id=&quot;left_name&quot; class=&quot;sh&quot; style=&quot;top:0; left:0&quot;>
S
<span class=&quot;v&quot;>
a
</span>
r
<span class=&quot;v&quot;>
a
</span>
C
<span class=&quot;v&quot;>
r
</span>
e
<span class=&quot;v&quot;>
a
</span>
t
<span class=&quot;v&quot;>
i
</span>
o
<span class=&quot;v&quot;>
n
</span>
s
</div>
<div id=&quot;right_name&quot; class=&quot;sh&quot; style=&quot;top:0; left:0&quot;>
<span class=&quot;v&quot;>
S
</span>
a
<span class=&quot;v&quot;>
r
</span>
a
<span class=&quot;v&quot;>
C
</span>
r
<span class=&quot;v&quot;>
e
</span>
a
<span class=&quot;v&quot;>
t
</span>
i
<span class=&quot;v&quot;>
o
</span>
n
</div>


<p align=&quot;center&quot;>
<strong>
<font face=&quot;Arial&quot;>
<big>
Please wait 5 seconds...
</big>
</font>
</strong>
</p>

<script>

/*
Count down then redirect script 2
By William Kemper (kemperwilliam@hotmail.com)
For this script and more, visit */

//specify redirect url
var redirecturl=&quot;home.html&quot;
//specify pause duration before redirection (in seconds)
var pausefor=5
//DONE EDITING

function postaction(){
if (window.timer){
clearInterval(timer)
clearInterval(timer_2)
}
window.location=redirecturl
}
setTimeout(&quot;postaction()&quot;,pausefor*1000)

</script>


<!--[if IE]>

<script language=&quot;JavaScript1.2&quot;>

<!--

// this script was originally authored by william kemper. I have no homepage.
var switchm=new Array
switchm[0]=&quot;ffaa00&quot;;
switchm[1]=&quot;ffff00&quot;;
switchm[2]=&quot;00ff00&quot;;
switchm[3]=&quot;0099ff&quot;;
switchm[4]=&quot;ff0000&quot;;
switchm[5]=&quot;ff00ff&quot;;
// if you want to add more colors go ahead, all the for limits are based on array length so
// you shouldn't need to change any of the code, just add more colors.

i=0
j=0
function STROBE()
{
if (j>increment.length-1)
{
j=0
i++
if (i>switchm.length-1)
{
i=0
}
}
document.all.increment[j].filters.blendTrans.apply()
document.all.increment[j].bgColor=switchm
document.all.increment[j].filters.blendTrans.play()
j++
}
timer=setInterval(&quot;STROBE()&quot;,20) // change the number to effect the speed of the loadbar.
timer_2=setInterval(&quot;REVEAL()&quot;,20)
function REVEAL()
{
if (document.images[0].complete)
{
clearInterval(timer)
clearInterval(timer_2)
document.all.loadbar.style.visibility=&quot;hidden&quot;;
document.all.content.style.visibility=&quot;visible&quot;;
}
}
// i don't know how to put comments in the css, but change duration to effect the speed of the fade effect.



//-->

</body>

</html>
 
I have read this over a hundred times and I can't figure it out. Please look it over. Currently employed as a Web Site Administrator.

In the process of creating my own Web design business.
 
only print the area with the error, than we can help
 
I don't really know where the error is. Here is what's supposed to happen and what is happening:

&quot;S r C e t o s&quot; is supposed to come in from the left and &quot;a a r a i n&quot; should come in from the right to say Sara Creations. Then an other Sara Creations forms a couple pixels down and to the left to make a shadow of the first. It ends up with 6 shadows each a different color.

What's happening is the very first Sara Creations is way too big. The shadows are all the size I want them but the first one is so big that the shadows don't line up with it.


Does anyone know what I'm talking about? Currently employed as a Web Site Administrator.

In the process of creating my own Web design business.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top