Click to See Complete Forum and Search --> : DHTML news box


chris9902
08-01-2003, 05:09 PM
i am looking for a text box that i can display upto 10 messages in.

it has to display 1 message at a time.

if possible i want the effect to be like this.


the message is displayed like a typewriter effect then scrolls up then the next displays

thanks SO much to anyone

havik
08-01-2003, 05:38 PM
Try Mike's DHTML scroller and add the typewriter effect
http://www.dynamicdrive.com/dynamicindex2/index.html

Havik

chris9902
08-01-2003, 05:46 PM
you have to know what my next question is.

how do i do that?:rolleyes:

havik
08-01-2003, 05:57 PM
lol, what about trying this one instead?
http://www.dynamicdrive.com/dynamicindex2/typescroll.htm

I could take a look at combining the scripts but then I'd need permission from the authors. Our little secret though...

Havik

chris9902
08-01-2003, 06:12 PM
ok forget the typing thing

with Mike's scroll how do i align the text to the top

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<div id="tempholder"></div>
<script language="JavaScript" src="dhtmllib.js"></script>
<script language="JavaScript" src="scroller.js"></script>
<script language="JavaScript">

//SET SCROLLER APPEARANCE AND MESSAGES
var myScroller1 = new Scroller(0, 0, 170, 140, 1, 5); //(xpos, ypos, width, height, border, padding)
myScroller1.setColors("#000000", "#f4f4f4", "#000000"); //(fgcolor, bgcolor, bdcolor)
myScroller1.setFont("Verdana,Arial,Helvetica", 2);
myScroller1.addItem("<b>Headline</b><BR>this would be text one");
myScroller1.addItem("<b>Headline</b><BR>this would be text one");
myScroller1.addItem("<b>Headline</b><BR>this would be text one");
myScroller1.addItem("<b>Headline</b><BR>this would be text one");
myScroller1.addItem("<b>Headline</b><BR>this would be text one");
//SET SCROLLER PAUSE
myScroller1.setPause(2500); //set pause beteen msgs, in milliseconds

function runmikescroll() {

var layer;
var mikex, mikey;

// Locate placeholder layer so we can use it to position the scrollers.

layer = getLayer("placeholder");
mikex = getPageLeft(layer);
mikey = getPageTop(layer);

// Create the first scroller and position it.

myScroller1.create();
myScroller1.hide();
myScroller1.moveTo(mikex, mikey);
myScroller1.setzIndex(100);
myScroller1.show();
}

window.onload=runmikescroll
</script>
<div id="placeholder" style="position:relative; width:170px; height:140px;"> </div>
</body>
</html>

havik
08-01-2003, 06:39 PM
align to the top? Do you want the text to stop at the top instead of the center?

Havik

chris9902
08-02-2003, 07:51 AM
yes please

havik
08-02-2003, 10:37 PM
In the scroller.js file, locate this section of the code:
Changes are made in red.

Havik

// Set up HTML code for item text.

start = '<table border=0'
+ ' cellpadding=' + (this.padding + this.border)
+ ' cellspacing=0'
+ ' width=' + this.width
+ ' height=' + this.height + '>'
+ '<tr><td valign=top>'
+ '<font'
+ ' color="' + this.fgColor + '"'
+ ' face="' + this.fontFace + '"'
+ ' size=' + this.fontSize + '>';
end = '</font></td></tr></table>';

chris9902
08-03-2003, 07:46 AM
thats fantastic

thanks alot:) :D :) :D :) :D :)

havik
08-03-2003, 01:43 PM
No problem :D

Havik