Results 1 to 6 of 6

Thread: Dissolve text using JavaScript

  1. #1
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dissolve text using JavaScript

    Hi

    I done HTML Static pages for that page i need javascript to dissolve the text plz any one guide how to do that.

    this is the like
    www.reefvilla.com

    in this i wont dissolve text "leave only footprints behind" to "the ultimate tropical beach villa"
    plz any one help me to slove the my problem

    thank you in advence.

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    I looked through the DD archives and found the Dissolving Text Effect, but it only works in IE5. Can anyone tell me what the IE-only CSS does and why it can't be ported to other browsers? As far as I can tell, the entire JS should port fine.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

  3. #3
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Hope this helps:
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html><head><title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    #wrap{width:500px;padding:10px;border:3px double #999;
    font-family:arial,helvetica,serif;
    font-size:20pt;text-align:center;margin:30px auto;}
    #message{height:1%;color:#930;filter:alpha(opacity=0);opacity:0;}
    </style>
    <script type="text/javascript">
    /*
    Code Title: Dissolve Text
    Author: Raymond Angana
    Created: August 14, 2008
    rangana in dynamicdrive.com/forums
    This notice must stay intact for legal use
    */
    var txt=['Leave only footprints behind...','The ultimate tropical beach villa.'],
    init=0,i=0,k=0,speed=50,el;
    function fade(){
    init==0?i++:i--;
    el.filters?el.style.filter='alpha(opacity='+i+')':el.style.opacity=i/100;
    el.firstChild.nodeValue=txt[k];
    if(i==100)init=1;
    if(i==0) {init=0;k++;}
    if(k==txt.length)k=0;
    setTimeout('fade()',speed);}
    window.onload=function(){el=document.getElementById('message');fade();}
    </script>
    </head><body><div id="wrap"><div id="message">&nbsp;</div></div></body></html>
    Last edited by rangana; 08-15-2008 at 04:55 AM.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  4. #4
    Join Date
    Feb 2008
    Posts
    63
    Thanks
    2
    Thanked 8 Times in 8 Posts

    Default

    rangana,
    I've saved this script on my drive - it's really nice and I think I'll be using it sometime. Is this a Dynamic Drive script? How do I put the credit in for this script??

    Thanks!
    Sandy k

  5. #5
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    It's not a DD script. It was done by request.
    Anyway, you can freely use that code. I've edited the code above to depict the credit.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  6. #6
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know this post is old, but I just stumbled across it. It's brilliant, rangana! Is there a way that I can put line breaks in it? I want to use it for longer amounts of text.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •