Adjusting typewriter scroller script

Discussion in 'Javascript' started by mistral, Mar 23, 2007.

  1. mistral

    mistral Guest

    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>
     
    mistral, Mar 23, 2007
    #1
    1. Advertising

  2. mistral

    mistral Guest

    On 23 ÍÁÒ, 14:49, Randy Webb <> wrote:
    > mistral said the following on 3/23/2007 8:37 AM:
    >
    > > Below is Typewriter Scroller script.

    >
    > 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
     
    mistral, Mar 23, 2007
    #2
    1. Advertising

  3. mistral

    mistral Guest

    On 23 mar, 14:49, Randy Webb <> wrote:
    > mistral said the following on 3/23/2007 8:37 AM:


    > > Below is Typewriter Scroller script.


    > 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, 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.
     
    mistral, Mar 23, 2007
    #3
  4. mistral

    ASM Guest

    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'


    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    Stephane Moriaux and his (less) old Mac already out of date
     
    ASM, Mar 23, 2007
    #4
  5. mistral

    ASM Guest

    Randy Webb a écrit :
    > mistral said the following on 3/23/2007 10:26 AM:
    >> No, I meant this: <URL:
    >> http://www.dhtmldev.com/examples/js/typewriter_effect/>

    >
    >> plus show text repeatedly (loop)?

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


    Will that empty the div before to fill it again ?


    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    Stephane Moriaux and his (less) old Mac already out of date
     
    ASM, Mar 23, 2007
    #5
  6. mistral

    mistral Guest

    On 23 ÍÁÒ, 21:24, Randy Webb <> wrote:
    > mistral said the following on 3/23/2007 10:26 AM:
    >
    >
    >
    >
    >
    > > On 23 mar, 14:49, Randy Webb <> wrote:
    > >> mistral said the following on 3/23/2007 8:37 AM:

    >
    > >>> Below is Typewriter Scroller script.

    >
    > >> 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, I meant this: <URL:http://www.dhtmldev.com/examples/js/typewriter_effect/>

    >
    > 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?
    >
    > > Does someone know how to omit border & background color from div
    > > container (style="visibility:hidden" ?),

    >
    > Yes, remove the border and color definitions in the CSS.
    >
    > > set font size/color/family,

    >
    > Use CSS.
    >
    > > plus show text repeatedly (loop)?

    >
    > 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
     
    mistral, Mar 23, 2007
    #6
  7. mistral

    ASM Guest

    ASM a écrit :
    > Randy Webb a écrit :
    >> mistral said the following on 3/23/2007 10:26 AM:
    >>> No, I meant this: <URL:
    >>> http://www.dhtmldev.com/examples/js/typewriter_effect/>

    >>
    >>> plus show text repeatedly (loop)?

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

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


    reading the script that would do

    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    Stephane Moriaux and his (less) old Mac already out of date
     
    ASM, Mar 23, 2007
    #7
  8. mistral

    -Lost Guest

    "mistral" <> wrote in message
    news:...
    > On 23 ÍÁÒ, 21:24, Randy Webb <> wrote:
    >> mistral said the following on 3/23/2007 10:26 AM:


    > 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
     
    -Lost, Mar 24, 2007
    #8
  9. mistral wrote:

    > 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..."

    --
    Richard.
     
    Richard Formby, Mar 24, 2007
    #9
  10. mistral

    -Lost Guest

    "Richard Formby" <> wrote in message
    news:Sq4Nh.1151$...
    > mistral wrote:
    >
    >> 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..."


    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
     
    -Lost, Mar 24, 2007
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex D.

    horizontal news scroller?

    Alex D., Aug 30, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,296
    Alex D.
    Aug 30, 2005
  2. Ian Hurst (Troyka)

    horizontal scroller with images

    Ian Hurst (Troyka), Feb 27, 2004, in forum: HTML
    Replies:
    8
    Views:
    2,753
    Toby A Inkster
    Feb 28, 2004
  3. clintonG

    News Scroller ???

    clintonG, Feb 22, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    510
  4. Dan

    Javascript Typewriter Ticker

    Dan, Mar 12, 2005, in forum: Javascript
    Replies:
    3
    Views:
    285
  5. Razvan

    Best Java Script Scroller

    Razvan, Aug 22, 2005, in forum: Javascript
    Replies:
    3
    Views:
    100
    Stephen Chalmers
    Aug 24, 2005
Loading...

Share This Page