Adjusting typewriter scroller script

M

mistral

Below is Typewriter Scroller script. I want adjust is as follows:
remove lower dash "_" out; display text not in form, but inside div,
without any borders (style="visibility:hidden"). Also I need control
via css font size, color, family. How to adjust this?

<script language="javascript" type="text/javascript">

<!-- begin
var max=0;
function textlist()
{
max=textlist.arguments.length; for (i=0; i<max; i++)
this=textlist.arguments;
}
tl=new textlist
(
"Welcome to my website!"
);
var x=0; pos=0;
var l=tl[0].length;
function textticker()
{
document.tickform.tickfield.value=tl[x].substring(0,pos)+"_";
if(pos++==l)
{
pos=0;
setTimeout("textticker()",1000);
x++;
if(x==max)
x=0;
l=tl[x].length;
} else
setTimeout("textticker()",50);
}

document.write("<FORM NAME=\"tickform\">");
document.write("<INPUT TYPE=\"TEXT\" NAME=\"tickfield\" SIZE=
\"30\">");
document.write("</FORM>");
document.tickform.tickfield.style.background = '#FFFFCE';
document.tickform.tickfield.style.color = 'red';
textticker();
//-->
</script>
 
M

mistral

mistral said the following on 3/23/2007 8:37 AM:


You mean something like this:

<URL:http://members.aol.com/_ht_a/hikksnotathome/typingText.html>

It is old (about 6/7 years) and could probably be written more efficiently.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/

------

no, like this
http://www.yaldex.com/FSScrolls/TypewriterScroller.htm

with abovementioned corections.

Mistral
 
M

mistral

mistral said the following on 3/23/2007 8:37 AM:
You mean something like this:

It is old (about 6/7 years) and could probably be written more efficiently.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
-------------

No, I meant this: <URL: http://www.dhtmldev.com/examples/js/typewriter_effect/>

<!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>Typewriter Effect Example</title>
</head>

<body>

<h1>Typewriter Effect Example</h1>

<p>View source to see the JavaScript.</p>

<script type="text/javascript">

function Typewriter(sName)
{ // PROPERTIES
this.counter = 0;
this.name = sName;
this.text = "";
this.speed = 50; // in milliseconds

// METHODS
this.addText = AddText;
this.next = Next;
this.setSpeed = SetSpeed;
this.write = Write;

// FUNCTIONS
function AddText(s)
{ this.text = s
}
function Next()
{ document.getElementById('typewriter_output').innerHTML =
this.text.substr(0, this.counter++);
}
function SetSpeed(iSpeed)
{ this.speed = iSpeed;
}
function Write()
{ setInterval(this.name+".next()",this.speed);
}
}

</script>

<div id="typewriter_output" style="width:400px;border:1px black
solid;padding:1em;background:#f3f3f3;"></div>

<script type="text/javascript">
var myTypewriter = new Typewriter("myTypewriter");
myTypewriter.addText("Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Suspendisse eu nisi nec nunc tempor pharetra.
Phasellus sit amet lorem. Sed at lacus id augue rhoncus euismod.
Maecenas eleifend, dolor et facilisis accumsan, purus enim pulvinar
leo, non vehicula augue nulla posuere justo. Pellentesque est. Donec
dignissim. Sed semper. Donec turpis. Class aptent taciti sociosqu ad
litora torquent per conubia nostra, per inceptos hymenaeos. Morbi
viverra. Proin scelerisque.");
myTypewriter.write();
</script>



</body>
</html>


Does someone know how to omit border & background color from div
container (style="visibility:hidden" ?), set font size/color/family,
plus show text repeatedly (loop)?

Regards.
 
A

ASM

mistral a écrit :
<http://www.dhtmldev.com/examples/js/typewriter_effect/>

Does someone know how to omit border & background color from div
container (style="visibility:hidden" ?), set font size/color/family,
plus show text repeatedly (loop)?

everything is here :

<div id="typewriter_output" style="width:400px;border:1px black
solid;padding:1em;background:#f3f3f3;"></div>

you only have to modify the style of 'typewriter_output'
 
A

ASM

Randy Webb a écrit :
mistral said the following on 3/23/2007 10:26 AM:


When it finishes call the function again.....

Will that empty the div before to fill it again ?
 
M

mistral

mistral said the following on 3/23/2007 10:26 AM:






Why would anybody put XHTML on the web to start with? Other than that,
it satisfies exactly what I said where a typewriter script could be
written more efficiently.

BTW, are you mistral or mar from the other thread?


Yes, remove the border and color definitions in the CSS.


Use CSS.


When it finishes call the function again.....

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/- óËÒÙÔØ ÃÉÔÉÒÕÅÍÙÊ ÔÅËÓÔ -
--------

OK, I agree, javascript is not right choice for advanced tasks that
required powerful visualization, etc. Its only suitable for poor and
primitive tasks, and for newbies. The two aboved samples is just
garbage, however, no one will ever use it for web pages. Also, most
of this javscripts from this javascript-related websites and
depositories is pretty useless for any advanced web development
tasks,just collection of various garbage. Most tasks can be done in
php. Javascript is old and ineffective.

mistral
 
L

-Lost

OK, I agree, javascript is not right choice for advanced tasks that
required powerful visualization, etc. Its only suitable for poor and
primitive tasks, and for newbies. The two aboved samples is just
garbage, however, no one will ever use it for web pages. Also, most
of this javscripts from this javascript-related websites and
depositories is pretty useless for any advanced web development
tasks,just collection of various garbage. Most tasks can be done in
php. Javascript is old and ineffective.

Firstly, no one said that JavaScript was not the right choice, so you are not agreeing
with anyone.

Secondly, your entire statement is moronic. It makes no sense, and surely is based on
your opinion only. Basically, everything you just said is the exact opposite.

Nothing against you of course, you are just wrong.

-Lost
 
R

Richard Formby

mistral said:
OK, I agree, javascript is not right choice for advanced tasks that
required powerful visualization, etc. Its only suitable for poor and
primitive tasks, and for newbies. The two aboved samples is just
garbage, however, no one will ever use it for web pages. Also, most
of this javscripts from this javascript-related websites and
depositories is pretty useless for any advanced web development
tasks,just collection of various garbage. Most tasks can be done in
php. Javascript is old and ineffective.

I await Mr Cornford's reply on this matter, he being in a team that is
developing a 'something' that includes 7,000, or is it 70,000, lines of
javascript :)

Hardly "not the right choice for advanced..."
 
L

-Lost

Richard Formby said:
I await Mr Cornford's reply on this matter, he being in a team that is developing a
'something' that includes 7,000, or is it 70,000, lines of javascript :)

Hardly "not the right choice for advanced..."

70,000. Which, however, is not indicative of how "advanced" it is, only of how involved
it is, or rather its scale.

I would however also imagine that if Cornford is involved it is not something trivial, or
as small-scale as a typewriter script.

-Lost
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top