<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: effects code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Tue, 22 Jul 2008 21:33:52 GMT</pubDate>
    <description>DZone Snippets: effects code</description>
    <item>
      <title>Typed Tooltip Effect</title>
      <link>http://snippets.dzone.com/posts/show/3706</link>
      <description>This simple bit of scripting will create a dynamic typing effect for your tool tips.&lt;br /&gt;The script can be &lt;a href="http://www.expertsrt.com/scripts/Cd/typed_tooltip.html"&gt;&lt;br /&gt;seen implemented here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var str='';&lt;br /&gt;var obj='false';&lt;br /&gt;var pntr='';&lt;br /&gt;var cnt=0;&lt;br /&gt;var textArr = new Array(5);&lt;br /&gt;textArr[0] = "All your bases are belong to us!";&lt;br /&gt;textArr[1] = "The answer is 42; of course.";&lt;br /&gt;textArr[2] = "The end of the universe will be the result of a mis-calculation in the core.";&lt;br /&gt;textArr[3] = "I don't believe its alive; but it thinks it is.";&lt;br /&gt;textArr[4] = "About 10 seconds after you open it; you'll wish you hadn't";&lt;br /&gt;&lt;br /&gt;function looptext()&lt;br /&gt;{&lt;br /&gt;   obj.innerHTML=str.substr(0,cnt);&lt;br /&gt;   cnt++;&lt;br /&gt;   if (cnt&lt;=str.length) setTimeout('looptext()',100);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function typeText(lnk,lyr)&lt;br /&gt;{&lt;br /&gt;   str=textArr[lyr];&lt;br /&gt;   pntr= 'lyr'+lyr;&lt;br /&gt;   obj=document.getElementById(pntr);&lt;br /&gt;   obj.style.left=(lnk.offsetLeft+30)+'px';&lt;br /&gt;   obj.style.top=(lnk.offsetTop+25)+'px';&lt;br /&gt;   obj.style.display='block';&lt;br /&gt;   cnt=1;&lt;br /&gt;   looptext();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function clearText(lyr)&lt;br /&gt;{&lt;br /&gt;   cnt=2500;&lt;br /&gt;   pntr='lyr'+lyr;&lt;br /&gt;   obj=document.getElementById(pntr);&lt;br /&gt;   obj.style.display='none';&lt;br /&gt;   obj.style.left='-50px';&lt;br /&gt;   obj.style.top='-50px';&lt;br /&gt;   obj.innerHTML='&amp;nbsp;';&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The links using the effect are done this way:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;   &lt;a href="javascript:alert('no page linked')"&lt;br /&gt;      onmouseover="typeText(this,2)"&lt;br /&gt;      onmouseout="clearText(2)"&lt;br /&gt;      onclick="clearText(2)"&gt; &lt;br /&gt;   This is link Three&lt;br /&gt;   &lt;/a&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 20 Mar 2007 11:31:22 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3706</guid>
      <author>COBOLdinosaur (Roy Marchand)</author>
    </item>
    <item>
      <title>Scriptaculous JavaScript slideshow</title>
      <link>http://snippets.dzone.com/posts/show/1320</link>
      <description>Found this amazing code by obie at &lt;a href="http://blog.caboo.se/articles/2006/01/19/easy-scriptaculous-slideshow"&gt;http://blog.caboo.se/articles/2006/01/19/easy-scriptaculous-slideshow&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;var album = { &lt;br /&gt;  startup: function() { &lt;br /&gt;    new PeriodicalExecuter(album.cycle, 5) // change image every 5 seconds &lt;br /&gt;  }, &lt;br /&gt;  cycle: function() { &lt;br /&gt;    new Effect.Fade('image', { // the id of the &lt;DIV&gt; containing the photos &lt;br /&gt;      duration: 1, &lt;br /&gt;      fps: 50, &lt;br /&gt;      afterFinish: function() { &lt;br /&gt;        new Ajax.Updater('image','/album/next', { // URL for next &lt;IMG&gt; tag &lt;br /&gt;          asynchronous: true, &lt;br /&gt;          onSuccess: function() { &lt;br /&gt;            new Effect.Appear('image', {&lt;br /&gt;              duration: 1,&lt;br /&gt;              fps: 50,&lt;br /&gt;              queue:'end'&lt;br /&gt;            })&lt;br /&gt;          } &lt;br /&gt;        }) &lt;br /&gt;      } &lt;br /&gt;    }) &lt;br /&gt;  } &lt;br /&gt;} &lt;br /&gt; &lt;br /&gt;window.onload = album.startup&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I want to tweak it so that an earlier event precaches the next image instead.</description>
      <pubDate>Tue, 31 Jan 2006 21:12:58 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1320</guid>
      <author>peter (Peter Cooperx)</author>
    </item>
    <item>
      <title>Miniature slideshow for DIVs using Scriptaculous</title>
      <link>http://snippets.dzone.com/posts/show/1068</link>
      <description>&lt;code&gt;&lt;div id="slideshow1" class="slide"&gt;&lt;div&gt;frame 1&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div id="slideshow2" class="slide" style="display: none"&gt;&lt;div&gt;frame 2&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div id="slideshow3" class="slide" style="display: none"&gt;&lt;div&gt;frame 3&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div id="slideshow4" class="slide" style="display: none"&gt;&lt;div&gt;frame 4&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;    &lt;br /&gt;    start_slideshow(1, 4, 2000);&lt;br /&gt;    &lt;br /&gt;    function start_slideshow(start_frame, end_frame, delay) {&lt;br /&gt;        setTimeout(switch_slides(start_frame,start_frame,end_frame, delay), delay);&lt;br /&gt;    }&lt;br /&gt;                            &lt;br /&gt;    function switch_slides(frame, start_frame, end_frame, delay) {&lt;br /&gt;        return (function() {&lt;br /&gt;            Effect.Fade('slideshow' + frame);&lt;br /&gt;            if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; }&lt;br /&gt;            setTimeout("Effect.Appear('slideshow" + frame + "');", 850);&lt;br /&gt;            setTimeout(switch_slides(frame, start_frame, end_frame, delay), delay + 850);&lt;br /&gt;        })&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;/script&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 05 Jan 2006 20:16:11 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1068</guid>
      <author>peter (Peter Cooperx)</author>
    </item>
    <item>
      <title>Effect.MoveTo</title>
      <link>http://snippets.dzone.com/posts/show/1023</link>
      <description>&lt;code&gt;&lt;br /&gt;Effect.MoveTo = Class.create();&lt;br /&gt;Object.extend(Object.extend(Effect.MoveTo.prototype, Effect.MoveBy.prototype), {&lt;br /&gt;  update: function(position) {&lt;br /&gt;    var topd  = (this.toTop - this.originalTop) * position + this.originalTop;&lt;br /&gt;    var leftd = (this.toLeft - this.originalLeft) * position + this.originalLeft;&lt;br /&gt;    this.setPosition(topd, leftd);&lt;br /&gt;  }&lt;br /&gt;});&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 28 Dec 2005 02:27:47 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1023</guid>
      <author>youpy (Youpy)</author>
    </item>
  </channel>
</rss>
