elliottbenzle
asked on
help setting vertical alignment in cell
I'm using a copied Javascript code to scroll text across my screen. I would like the text to be vertically aligned in the center (now it is too high), but the code is too complicated for me to figure out. Can someone please take a look at this and tell me how to align the scrolling text in the middle?
Here is the page URL:
http://www.glowfishtw.com/flagfootball/scroller.aspx
Here is the code:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859 -1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
A { text-decoration:none;}
A:link {color:#FFFFFF;}
A:visited{color: #FFFFFF;}
A:hover {color: red;background-color:#66ff ff;}
.tab {font-size:12px;font-famil y:Arial,He lvetica;co lor:#FFFFF F;}
.tabb {font-size:12px; font-family:Arial,Helvetic a;}
</style>
<SCRIPT LANGUAGE="JavaScript">
/************************* **********
* http://javascripts.vbarsan.com/
* This notice may not be removed
************************** *********/
//-- Begin Scroller's Parameters and message -->
//scroller width: change to your own;
var wwidth=690;
//scroller height: change to your own;
var wheight=25;
//background color: change to your own;
var wbcolor="#ccffcc";
//scroller's speed: change to your own;
var sspeed=2;
var restart=sspeed;
var rspeed=sspeed;
//text: change to your own
wwholemessage='<nobr class=tab><b>I want this text vertically aligned in the center of the bg image, instead of a the top.</b></nobr>';
//-- end Parameters and message-->
//-- begin: Scroller's Algorithm -->
var sizeupw=0;var operbr=navigator.userAgent .toLowerCa se().index Of('opera' );if(operb r==-1&&nav igator.pro duct&&navi gator.prod uct=="Geck o"){var agt = navigator.userAgent.toLowe rCase();va r rvStart = agt.indexOf('rv:');var rvEnd = agt.indexOf(')', rvStart);var check15 = agt.substring(rvStart+3, rvEnd);if(parseFloat(check 15)>=1.8) operbr=0;}if (navigator.appVersion.inde xOf("Mac") !=-1)operb r=0;
function goup(){if(sspeed!=rspeed*8 ){sspeed=s speed*2;re start=sspe ed;}}
function godown(){if(sspeed>rspeed) {sspeed=ss peed/2;res tart=sspee d;}}
function startw(){if(document.getEl ementById) ns6marquee w(document .getElemen tById('wsl ider'));el se if(document.all) iemarqueew(wslider);else if(document.layers)ns4marq ueew(docum ent.wslide r1.documen t.wslider2 );}functio n iemarqueew(whichdiv){iediv w=eval(whi chdiv);ied ivw.style. pixelLeft= wwidth+"px ";iedivw.i nnerHTML=' <nobr>'+ww holemessag e+'</nobr> ';sizeupw= iedivw.off setWidth;i eslidew(); }function ieslidew(){if(iedivw.style .pixelLeft >=sizeupw* (-1)){iedi vw.style.p ixelLeft-= sspeed+"px ";setTimeo ut("ieslid ew()",100) ;}else{ied ivw.style. pixelLeft= wwidth+"px ";ieslidew ();}}funct ion ns4marqueew(whichlayer){ns 4layerw=ev al(whichla yer);ns4la yerw.left= wwidth;ns4 layerw.doc ument.writ e('<nobr>' +wwholemes sage+'</no br>');ns4l ayerw.docu ment.close ();sizeupw =ns4layerw .document. width;ns4s lidew();}f unction ns4slidew(){if(ns4layerw.l eft>=sizeu pw*(-1)){n s4layerw.l eft-=sspee d;setTimeo ut("ns4sli dew()",100 );}else{ns 4layerw.le ft=wwidth; ns4slidew( );}}functi on ns6marqueew(whichdiv){ns6d ivw=eval(w hichdiv);n s6divw.sty le.left=ww idth+"px"; ns6divw.in nerHTML='< nobr>'+wwh olemessage +'</nobr>' ;sizeupw=n s6divw.off setWidth;i f(operbr!= -1){docume nt.getElem entById('o peraslider ').innerHT ML='<nobr> '+wwholeme ssage+'</n obr>';size upw=docume nt.getElem entById('o peraslider ').offsetW idth;}ns6s lidew();}f unction ns6slidew(){if(parseInt(ns 6divw.styl e.left)>=s izeupw*(-1 )){ns6divw .style.lef t=parseInt (ns6divw.s tyle.left) -sspeed+"p x";setTime out("ns6sl idew()",10 0);}else{n s6divw.sty le.left=ww idth+"px"; ns6slidew( );}}
//-- end Algorithm -->
</script>
<!-- End of Script between <head> & </head> tags-->
</head>
</head>
<body onload="startw();">
<!-- You may remove first cell below (<td> ... </td>) to get rid of Speed-change -->
<script language="JavaScript">docu ment.write ('<table align="center" border="0"><tr><td width='+wwidth+'px>');if(d ocument.ge tElementBy Id || document.all){document.wri te('<span style="width:'+wwidth+'px; "><div style="position:relative;o verflow:hi dden;width :'+wwidth+ 'px;height :'+wheight +'px;clip: rect(0 '+wwidth+'px '+wheight+'px 0);background-image: url(images/topbar.jpg);" onMouseover="sspeed=0;" onMouseout="sspeed=restart ">');if(op erbr!=-1)d ocument.wr ite('<div id="operaslider" style="position:absolute;v isibility: hidden;">< /div>');do cument.wri te('<div id="wslider" style="position:absolute;h eight:'+wh eight+'px; "></div></ div></span >')}</scri pt>
<ilayer width=&{wwidth}; height=&{wheight}; name="wslider1" bgcolor=&{wbcolor};><layer name="wslider2" width=&{wwidth}; height=&{wheight}; onMouseover="sspeed=0;" onMouseout="sspeed=restart "></layer> </ilayer>< /td></tr>< /table>
<p>
<!-- end of code between BODY TAGS -->
</p>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
Thanks for any help.
Here is the page URL:
http://www.glowfishtw.com/flagfootball/scroller.aspx
Here is the code:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
A { text-decoration:none;}
A:link {color:#FFFFFF;}
A:visited{color: #FFFFFF;}
A:hover {color: red;background-color:#66ff
.tab {font-size:12px;font-famil
.tabb {font-size:12px; font-family:Arial,Helvetic
</style>
<SCRIPT LANGUAGE="JavaScript">
/*************************
* http://javascripts.vbarsan.com/
* This notice may not be removed
**************************
//-- Begin Scroller's Parameters and message -->
//scroller width: change to your own;
var wwidth=690;
//scroller height: change to your own;
var wheight=25;
//background color: change to your own;
var wbcolor="#ccffcc";
//scroller's speed: change to your own;
var sspeed=2;
var restart=sspeed;
var rspeed=sspeed;
//text: change to your own
wwholemessage='<nobr class=tab><b>I want this text vertically aligned in the center of the bg image, instead of a the top.</b></nobr>';
//-- end Parameters and message-->
//-- begin: Scroller's Algorithm -->
var sizeupw=0;var operbr=navigator.userAgent
function goup(){if(sspeed!=rspeed*8
function godown(){if(sspeed>rspeed)
function startw(){if(document.getEl
//-- end Algorithm -->
</script>
<!-- End of Script between <head> & </head> tags-->
</head>
</head>
<body onload="startw();">
<!-- You may remove first cell below (<td> ... </td>) to get rid of Speed-change -->
<script language="JavaScript">docu
<ilayer width=&{wwidth}; height=&{wheight}; name="wslider1" bgcolor=&{wbcolor};><layer
<p>
<!-- end of code between BODY TAGS -->
</p>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
Thanks for any help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
that javascript is obfuscated, that is why it is so difficult to read. i would try a clearer havescript: you may try looking in
http://www.dhtmlgoodies.com
or
http://dynamicdrive.com/
regards,
siranm