Click to See Complete Forum and Search --> : HELP: Text Scroller Script


his boy elroy
08-27-2003, 05:11 PM
I have a 147px X 147px table that I would like a Text Scroll to appear in. I found a script at the following:

http://simplythebest.net/info/dhtmlscript68.html

I believe I followed the instructions but proof is in the pudding. Can someone tell me where I went wrong:

http://edesedoret.com/client_support.html

I am trying to get the action to appear to the left of the text field that reads:

"Written Specification
_ A written specification is the road map essential to __the out come of any project."

Thanks in advance

gcrowan
08-27-2003, 11:01 PM
No biggie, you have a conflict in the onload command. Use this body tag:

<body background="images/background.gif" text="#999999" topmargin="0" onLoad="MM_preloadImages('images/home-gray.gif','images/company-orange.gif','images/integrated_design-green.gif');newsScrollInit();">

notice the - newsScrollInit() in the body tag. Now eliminate the - onload=newsScrollInt at the bottom of the javascript. Should look like this:

onload=newsScrollInit;
</script>
</head>

his boy elroy
08-28-2003, 06:03 AM
Thanks, It works great. Just what I was looking for.

his boy elroy
08-28-2003, 05:00 PM
The text scroll outside of the table:
http://edesedoret.com/client_support.html

Unfortunatly when I view it in Netscape it looks fine but in Internet explorer it shows up outside the table. Can anyone advice me on how to resolve this problem.

Thanks in advance...

gcrowan
08-28-2003, 09:05 PM
In a nutshell Netscape is difficult to work around. The problem is that Netscape and IE handle positioning differently. Absolute positioning is relative to the top left hand corner of the browser window. Tables that are given a percentage of the screen for their width cause positions to vary according to the users screen resolution but an object with absolute positioning will always display at exactly X pixels by Y pixels. This can cause out of place or overlapped objects. It is better to use relative positioning. That way the object is always displayed in sync with the rest of the page. I can go on about the problems which occur between browsers however I will just give you a simple solution. This will display for Netscape 4+ and IE 4+ and I believe is the simple solution outside of rewriting the entire functions.

First, replace your style tag with this:

<style type="text/css">
#divNewsCont{
position: relative;
width:145px;
height:145px;
overflow:hidden;
top:0px;
left:0px;
clip:auto;
visibility:hidden;
}
#divNewsText{
position: absolute;
top:325;
left:235;
}
</style>

Next replace the division tag - <div id="divNewsCont"> with this:

<script language="JavaScript">
<!--
if(navigator.appName == "Netscape"){
document.write('<div id="divNewsCont" style="top:-65px;left:0px;">');
}else{
document.write('<div id="divNewsCont">');
}
//-->
</script>

That should work.

his boy elroy
08-29-2003, 06:55 AM
Thanks for the help. Works fine in IE but in Netscape it completely destorted the page. Not only did it scroll the text in question but everything else on the page scrolled up. I replaced the Style tag which made sence, then I replaced the <div id="divNewsCont"> within the table in the Body with:

<td><script language="JavaScript">
<!--
if(navigator.appName == "Netscape"){
document.write('<div id="divNewsCont" style="top:-65px;left:0px;">');
}else{
document.write('<div id="divNewsCont">');
}
//-->
</script>
<div id="divNewsText">

Did I place this in the wrong place? I did not upload the change to my server.

gcrowan
08-29-2003, 02:49 PM
You should have done this correctly. The inline style takes president over the style tag. Use the inline styles to get Netscape to perform properly. I was viewing NS 4.7 and I haven't tried later versions. You might try changing the clip back to clip:rect(0,145,145,0);. The clip is like a mask that hides all the scrolling text with exception to the 145 x 145 box.