Go Back   Dynamic Drive Forums > DD Scripts > Dynamic Drive scripts help
Search Dynamic Drive Forums:

Closed Thread
 
Thread Tools Search this Thread
  #1  
Old 11-16-2005, 07:33 PM
favorite_radio favorite_radio is offline
New Comer (less than 5 posts)
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Typing text

http://dynamicdrive.com/dynamicindex10/text5.htm

I can't seem to get this animation to work on FireFox. I works on Windows and other browsers but not on FX. What am I don't wrong.

By the way I love the site. I was just introduced to it a week ago. Great job with the website.

Radio,
  #2  
Old 11-16-2005, 07:57 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

Quote:
I can't seem to get this animation to work on FireFox.
Quote:
Originally Posted by supported browsers
IE5+ Opr7+
That's why.
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
  #3  
Old 11-17-2005, 02:27 PM
favorite_radio favorite_radio is offline
New Comer (less than 5 posts)
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Twey

Is there a way I can make it work on FireFox.

radio
  #4  
Old 11-17-2005, 05:41 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

I have rewritten this script to use much more compliant functions. Use as the old version. Tested in Firefox v1.0.7, Opera v8, Konqueror v3.2.1, and IE v6.
Code:
<small><span id="typing">Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Phasellus risus nisl, vehicula in, hendrerit vitae, iaculis vel, nisl. Praesent rhoncus
semper velit. Ut sed nunc. Proin id metus eget neque consectetuer semper. Donec
consectetuer auctor nisl. Sed metus. Sed eu felis. Sed accumsan bibendum leo. Mauris
accumsan dapibus odio. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Integer sodales dui ac justo.<br/><br/>
Donec ante nulla, suscipit quis, pharetra id, consectetuer non, magna. Phasellus viverra
lobortis eros. Integer eu arcu. Praesent accumsan nunc ac ante mollis cursus. Class
aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.
Aenean volutpat enim vitae turpis. Vestibulum sit amet nunc. Maecenas nunc turpis,
cursus eu, vulputate sed, pretium id, urna. Suspendisse potenti.</span></small>

<script type="text/javascript">

/*
Typing Text Script
Last updated: 18/11/05
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
hundreds more DHTML scripts, and Terms Of
Use, visit http://www.dynamicdrive.com/.

Rewritten by Twey to be compatible with Firefox
(and now Konqueror and presumably Safari).
The script will strip all HTML tags from the text, but
non-supporting browsers won't.  This will allow you to
hide the text or display differently on such browsers.
*/

interval = 100; // Interval in milliseconds to wait between characters

if(document.getElementById) {
  t = document.getElementById("typing");
  if(t.innerHTML) {
    typingBuffer = ""; // buffer prevents some browsers stripping spaces
    it = 0;
    mytext = t.innerHTML;
    t.innerHTML = "";
    typeit();
  }
}

function typeit() {
  mytext = mytext.replace(/<([^<])*>/, "");     // Strip HTML from text
  if(it < mytext.length) {
    typingBuffer += mytext.charAt(it);
    t.innerHTML = typingBuffer;
    it++;
    setTimeout("typeit()", interval);
  }
}
</script>
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Last edited by Twey; 11-18-2005 at 06:40 PM. Reason: Made to work with Konqueror (and presumably Safari), which strips leading and trailing spaces from innerHTML.
  #5  
Old 11-20-2005, 07:16 AM
ddadmin's Avatar
ddadmin ddadmin is offline
Administrator
 
Join Date: Aug 2004
Posts: 7,626
Thanks: 2
Thanked 639 Times in 629 Posts
Blog Entries: 13
Default

Hi Trey:
Thanks for the code. I'll do some testing on it, and if all is well, update the script with your changes.

Thanks!

George
  #6  
Old 01-15-2006, 03:17 PM
AJRussell AJRussell is offline
New Comer (less than 5 posts)
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Another Q about Typing Text script

I have inserted this script into a test page, and I was wondering if there is a way to make the text repeat until the page is closed?

Please advise!

AJRussell
  #7  
Old 01-15-2006, 04:40 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

Try:
Code:
<small><span id="typing">Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Phasellus risus nisl, vehicula in, hendrerit vitae, iaculis vel, nisl. Praesent rhoncus
semper velit. Ut sed nunc. Proin id metus eget neque consectetuer semper. Donec
consectetuer auctor nisl. Sed metus. Sed eu felis. Sed accumsan bibendum leo. Mauris
accumsan dapibus odio. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Integer sodales dui ac justo.<br/><br/>
Donec ante nulla, suscipit quis, pharetra id, consectetuer non, magna. Phasellus viverra
lobortis eros. Integer eu arcu. Praesent accumsan nunc ac ante mollis cursus. Class
aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.
Aenean volutpat enim vitae turpis. Vestibulum sit amet nunc. Maecenas nunc turpis,
cursus eu, vulputate sed, pretium id, urna. Suspendisse potenti.</span></small>

<script type="text/javascript">

/*
Typing Text Script
Last updated: 18/11/05
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
hundreds more DHTML scripts, and Terms Of
Use, visit http://www.dynamicdrive.com/.

Rewritten by Twey to be compatible with Firefox
(and now Konqueror and presumably Safari).
The script will strip all HTML tags from the text, but
non-supporting browsers won't.  This will allow you to
hide the text or display differently on such browsers.
*/

interval = 100; // Interval in milliseconds to wait between characters

if(document.getElementById) {
  t = document.getElementById("typing");
  if(t.innerHTML) {
    typingBuffer = ""; // buffer prevents some browsers stripping spaces
    it = 0;
    mytext = t.innerHTML;
    t.innerHTML = "";
    typeit();
  }
}

function typeit() {
  mytext = mytext.replace(/<([^<])*>/, "");     // Strip HTML from text
  if(it < mytext.length) {
    typingBuffer += mytext.charAt(it);
    t.innerHTML = typingBuffer;
    it++;
    setTimeout("typeit()", interval);
  } else {
    t = document.getElementById("typing");
    if(t.innerHTML) {
      typingBuffer = ""; // buffer prevents some browsers stripping spaces
      it = 0;
      mytext = t.innerHTML;
      t.innerHTML = "";
      typeit();
    }
  }
}
</script>
Untested.
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
  #8  
Old 01-15-2006, 05:26 PM
AJRussell AJRussell is offline
New Comer (less than 5 posts)
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Scrolling until . . .

Thank you.

That worked great. And, thank you for responding so quickly.

AJRussell
  #9  
Old 02-04-2006, 10:56 AM
Glen Glen is offline
Junior Coders
 
Join Date: Feb 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi just thought i would add that you can easily use this as an external js file by encasing the if(document.getElementById){ part in a function and call it at the end of your document to check all using it.
  #10  
Old 05-30-2006, 02:55 AM
DreamMover DreamMover is offline
New Comer (less than 5 posts)
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This Script is amazing i love it.... there is something els i was wondering about also..... some sort of tweak or what not...

I was wondering if you can Make the Text Pause for an X-amount of time before it continues to the next line.. just to make it look as if someone is acctually typing on the other end hehehe... thanks.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:07 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.