Features

Features > AJAX

Why let script.aculo.us have all the fun? Start building your own Ajax-driven visual effects today.

The basic and prebuilt effects in script.aculo.us are nice, but if you really want to build something great why not investigate doing your own, homegrown, do-it-yourself effects. We’re going to show you how to take basic effects and build on them to create your own. So let’s get going.

First, download and include Prototype and script.aculo.us on your page as described in the installation instructions.

You’re ready to use the visual effects engine now! Give this short line a try:

<div onclick="Effect.Fade(this)">Fade me already!</div>

To tweak the effect, try something like this:

<div onclick="Effect.Fade(this,{duration:3})">Fade me slower!</div>

The cash register effect

You’re now ready to start building your own effects. All the pre-built effects in script.aculo.us really are about changing the style of elements, but there’s nothing to stop you from actually manipulating the contents of elements too. For our homegrown effect, we’ll do exactly that.

Say you have an online shop that uses AJAX for adding and removing products from a shopping basket. Of course, you may display a total for all the products in the basket, that gets automatically updated each time something changes. We want to give the user a clue that this total is correctly updated and reflects the current contents of the basket. You could use the Yellow Fade Technique, but we want to bring our own style in here and use something more snazzy.

So, we want to emulate the look and feel of an old cash register, and display the change in the total with a completely new homegrown effect, that dynamically adjusts the value from the old total to the new.

Without further ado, here’s a demo so you know what I’m talking about.
Plus you can download a zipped example (20KB) to follow along (it includes all the files you need).

Have a plan

To make use of the facilities the effects engine provides, you should sit down and think about what your effect really does. The important thing is to come up with a method that renders exactly one specific frame as the effect engine will ask your method to do that.

For our cash register effect that means that for the duration of the effect, on each rendering of a frame, it should display the result of the expression start_price + (price_delta * position), where price_delta = end_price - start_price and position refers to how far the effect is completed in a 0 to 1 range.

Example: Assume that the total currently displayed is $100.00 and we want to change that to $150.00. The value to display on position 0.5 (halfway through the effect) would be $125.00 or $100.00 + ($50.00 * 0.5) with price_delta = $150.00 - $100.00 = $50.00.

First frame (position 0):       <span id="total">$100.00</span>
Halfway-through (position 0.5): <span id="total">$125.00</span>
Last frame (position 1):        <span id="total">$150.00</span>

Effect skeleton

The visual effects engine provides a base class to build your own effects.
Effect.Base is used like this:

Effect.CashRegister = Class.create();
Object.extend(Object.extend(Effect.CashRegister.prototype, 
  Effect.Base.prototype), {
    // we’ll fill this up later
});

Next, we need to tell our new effect what to do.

The initialize() method

As dicussed earlier we want to have a transition from one price to another, and
need to find out the delta before we start the effect. For convinience, we also just
want to take the value that’s displayed in the element as a starting point, so we
won’t have to remember the “old” price:

initialize: function(element, price) {
  // optional third argument “options”
  var options = arguments[2] || {};

  // $ is a shortcut for document.getElementById in Prototype
  this.element = $(element);

  // find current price and parse it without the dollar sign
  this.startPrice = parseFloat(this.element.innerHTML.substring(1));

  // set finishPrice and precalculate delta
  this.finishPrice = price;
  this.delta = (this.finishPrice-this.startPrice);

  // the start method is provided by the effects engine
  // it should be the last line in your initialize() method
  this.start(options);
},

A short note on using the innerHTML property of a DOM element here: It’s neither good nor evil, it’s just there, in all browsers. So, do use it. It’s much faster than any XML sit-ups with the DOM anyway.

The update() method

For the heavy lifting in our effect, we need to define the update() method. This method is called repeatedly by the visual effects engine for each frame to render. It get’s the position parameter which is in the range of 0 to 1.

update: function(position) {
  // calculate value and convert to dollar/cent array
  var value = (this.startPrice + (this.delta*position)).toString().split(’.');

  // ensure two digits after the comma
  var cent  = value.length==1 ? ‘00′ : (
    value[1].length == 1 ? value[1]+”0″ : value[1].substring(0,2));

  // Element.update from Prototype sets the innerHTML of an element
  Element.update(this.element, ‘$’ + value[0] + ‘.’ + cent);
}

And that’s it. Your effect is ready. To actually use it, call it by using (for example):

new Effect.CashRegister('total',150);

If you want to have a little bit of that “slow motion awe” (where you’ll notice that easing in and out is automatically applied), try:

new Effect.CashRegister('total',150,{duration:10}); 

Here’s the complete code with the comments removed.

Effect.CashRegister = Class.create();
Object.extend(Object.extend(Effect.CashRegister.prototype, 
Effect.Base.prototype), {
  initialize: function(element, price) {
    var options = arguments[2] || {};
    this.element = $(element);
    this.startPrice = parseFloat(this.element.innerHTML.substring(1));
    this.finishPrice = price;
    this.delta = (this.finishPrice-this.startPrice);
    this.start(options);
  },
  update: function(position) {
    var value = (this.startPrice + (this.delta*position)).toString().split(’.');
    var cent  = value.length==1 ? ‘00′ : (
      value[1].length == 1 ? value[1]+”0″ : value[1].substring(0,2));
    Element.update(this.element, ‘$’ + value[0] + ‘.’ + cent);
  }
});

More things to explore

Of course, we’ve only scratched the surface here, so here’s a quick look at various other things waiting for discovery inside the visual effects engine:

Callbacks

At all stages while your effect runs, various callbacks can be used to do further processing. For example, if you want to issue an other effect after your effect has completed, you can use the afterFinish callback:

new Effect.CashRegister('total', 150, {
 afterFinish:function(effect){ new Effect.Highlight(effect.element) } 
});

Transitions

Transitions control the easing-in and out of effects, plus can be used for some more advanced control over how an effect should render itself. See the script.aculo.us wiki for more information

Queues

Effect queues are a tool to build powerful, time-line based animation. Here’s a great tutorial.

So what are you waiting for? Get out there and start creating your own wonderful world of visual effects.

About Scriptaculous

Among other things, script.aculo.us includes a fully-featured JavaScript effects engine that provides easy-to-use visual effects on the web. The primary goal is to enable AJAX-powered sites that give visual feedback to users, who otherwise might have no clue that page updates happen behind the scenes. The second use is to make in-page interactivity smoother (for example when a hidden panel opens, it can slide out smoothly instead of just popping up).

The visual effects engine first came to life as a part of Ruby on Rails and particularily the Prototype JavaScript framework, at a time when AJAX was very fresh and the Yellow Fade Technique had a revival. For the launch of script.aculo.us in June 2005, the engine was completely rewritten to provide a solid animation framework that’s easily expandable.

If you never heard about it, have a look at the demo page in the script.aculo.us documentation wiki. For a nice use of rich in-page interactivity visit Apple’s Aperture product web site, and try the “Key Features of Aperture” box at the right of the screen (scroll down a bit to see it), and the wollzelle homepage (try the references in the portfolio section).

For usage in an web application, you might want to check out the fluxiom teaser video (most stuff in the effects engine came out of the development of fluxiom).

What you don’t have to worry about

script.aculo.us’ time-based animation framework takes
care of all the tedious background processing and advanced functionality,
so you never have to worry about things like the rendering speed of the client/browser,
easying in and out and queueing up stuff in timelines.

You’ll automatically get all sorts of tweaking options and callback functionality
to really tune the effects to your liking (of course the provided effects come with
sane defaults, so you can just drop a line of JavaScript code in and you’re all set).

Also, anything is meant to work (and does!) on Internet Explorer 6, Firefox 1.0 and later, plus Safari.

Fuel is a brand new, affordable conference about powering your business with the web: London June 13

137 Responses to “Create your own Ajax effects”

  1. Bob says

    where is the demo of the effect you created?

  2. Arne says

    Hmm Thomas Fuchs.
    Scriptaculous.
    Article.
    Demo?
    Scan article.
    Demo? Where? Start, no? Bottom, no??
    No demo?

    Post stupid comment.

  3. Ryan Carson says

    Hey guys,

    We’ve just added the demo and a zip file for you. Sorry for the confusion!

  4. K Devi says

    Its great example of Ajax-driven visual effects using prototype and Scriptaculous… Keep it up…

  5. Bob says

    what would really be cool is like a cash register effect of numbers going down — I guess that’s what I thought this would show.

  6. Pete says

    Bob, the demo (second part) has an example of the numbers going down.

  7. Kay Bærulfsen says

    Ehm, where is the -ajax- part? :P This is just another visual effect, right?

  8. picture of Thomas Fuchs Thomas Fuchs says

    Kay: The effects are for AJAX driven websites.

  9. Gablarski says

    Except the title specifically says “AJAX Effects”. Maybe it should of said “web 2.0″ effects. This, like many other things, tend to give people that don’t know any better that AJAX is actually what “Web 2.0″ defines, and is not just a way to trasmit data without refreshing the page.

  10. B.K. says

    I thought that AJAX made use of XML, but there’s no XML use at in these examples. I’m confused while these effects are specifially said to be for AJAX sites, especially as the demo doesn’t appear to use AJAX.

    It’s very interesting stuff, don’t get me wrong, but I think I’m missing the link between these examples and an AJAX driven site. Could you fill in the gaps?

  11. picture of Thomas Fuchs Thomas Fuchs says

    B.K.: Most sites using AJAX don’t make use of XML at all but send plain HTML or JavaScript over the wire. As said before, effects are for supporting AJAX-driven websites, to help users to understand whats going on (from the article: “We want to give the user a clue that this total is correctly updated and reflects the current contents of the basket.”). For more examples and documentation see the script.aculo.us wiki.

  12. Ajaxian » Script.aculo.us: Create your own Ajax effects says

    […] Thomas Fuchs has written an article on creating your own Ajax effects. […]

  13. Fernando Lucas says

    I really don’t get where is the AJAX part in this. There’s only the J part. It’s all javascript. Geez, you of all people should know!

  14. picture of Thomas Fuchs Thomas Fuchs says

    Fernando Lucas: Ahem, as I said, it’s FOR AJAX-using stuff. Also, the title got changed to fit the green box at the top, and it’s catchy isn’t?

    Anyhow, I’d like to hear feedback on the contents of the article and not on semantic nit-picking. :)

  15. Devix Design says

    […] I was browsing through the articles of the new-born Vitamin, when I found this article by Thomas Fuchs. In sum, the article is an introduction to customized Javascript effects, like the ones you can find in Scriptaculous, but in your own way. […]

  16. Fernando Lucas says

    Well the article is fine, maybe a little bit short for people who are new to “AJAX”. But I really think it’s wrong to name it AJAX Effects as the title says, cause they’re not AJAX effects, they’re just JAVASCRIPT Effects.

    And, honesly, I think if this is to help people who already use AJAX to implement some cool effects, maybe you could show us some actual AJAX code that makes use of the FX code above, so they’ll know how it all works together.

  17. Chris Heilmann says

    I posted this on AJAXian, and repeat it here as I didn’t know there was a comment faciltiy (they showed the example)


    Wonderful, amazing, terrific, wow and all!
    Now all it needs is a practical use case or a need for

    Seriously, what is the benefit of a counter that counts up to a final number? I’d be well annoyed to have to wait for a basket for several seconds counting up to tell me the final amount I have to pay, and I doubt that any client would get more revenue from it. More hits, possibly, with web designers going “wheee” adding and deleting numbers and stopping before checkout.

    I don’t get it. Wollzelle prove with their fluxiom product that the stuff they develop in scriptalicious can make a pretty nifty application but all these bells and whistles examples will just lead developers and designers to make interfaces slower and more complex than necessary.

    It took us some years to get rid of the animated rainbow dividers, ticker scripts, rotating globes and @ signs, now we do the same with another technology. Heck, even in Powerpoints people are bored of animations.

    I am not saying that all animation is bad, there are good examples that help the flow through the application but I dare anyone to tell me a useful application for this example other than proving you can use a timeout to animate stuff.

    Reading the example here properly I realised that you wanted to show how to extend the scriptalicious library with your own effects. Understood.
    I still don’t consider it a good example, and it is a shame as your work is pretty amazing.
    However, with examples like this and the AJAX confusion mentioned in the comments here I think it is more disturbing than helpful to the Web2.0 movement. Our job is to use technology for the benefit of the user, not to show more visual effects.

  18. picture of Thomas Fuchs Thomas Fuchs says

    Chris: The duration is set to a long period so you can see what’s going on. In a proper page layout, with a duration of about 0.75s you’ll realize that this effect is extremly helpful for the user, if you’re inside an AJAX-based shopping page (for example). Humans are much better at registering motion than static images. It’s really just for: “ok, here is something that updates.”

    Because the yellow-fade technique is getting a bit boring, you’ll want to experiment with other things here.

    Plus, the example was choosen because of the simplicity of it, and the fact that it’s quite specialized (so the 80% of people can use it rule isn’t true for it, compared to stuff like SlideOut/In or Appear/Fade).

    Again: It’s not for everyone to frolick and start using it on every page they have. It’s for teaching how you can do your own visual effects with script.aculo.us. And not, repeat not, for an other lengthy, useless discussion of what you should or should not throw at your users as a web designer or developer. I can choose for myself, thank you.

  19. Chris Heilmann says

    Ah, sorry for taking the time to ask for a proof of why that would be a beneficial effect. Yes, you showed how you can extend scriptalicious, and I hope people will use it wisely.

    Discussions are what make products and ideas better, and I chose for myself not to bother about this anymore here then, thank you.

  20. picture of Thomas Fuchs Thomas Fuchs says

    Chris: I hope too that people wil use it wisely. I’m just tired of endless discussions (that don’t really lead somewhere, imho). Please don’t take this personally. :)

  21. carlos says

    This is no AJAX, AJAX is when you use the xmlhtprequest object. What you are explaining is how to create effects, but it is not exclusive for an Ajax web site as you said,

  22. snarkyfish says

    this isn’t ajax and shouldn’t be listed in your ‘AJAX’ category..

    it should be in a javascript or DHTML category.. i see you don’t have one.. make one.. and keep this stuff seperate.. so many people in these comments have gotten irritated about this because misuse of terms makes a developer’s job harder.. (when trying to communicate with clients)

    if it doesn’t fire off an xml transaction from the client side.. it ain’t ajax.

  23. Mitch says

    I think many of you miss the point of the article and are getting hung up on symantics. The title is “Create Your Own Ajax Effects“. The word “effects” in the title should clue you in that this may not be an Ajax topic in its purist form.

    Since most of the so-called “Web 2.0″ applications make heavy use of such effects to indicate content change in lieu of a page refresh, I think the topic and its title are perfectly appropriate.

    What next, if you handle the responseText property instead of responseXML in an XHR example would that invalidate it as Ajax? After all, it’s not called Ajat!

    As to the validity of the effect created in this article… it’s just an example! Might be useful to you, might not. Create your own effect with what you learned here!

    Thanks, Thomas!

  24. BarelyBlogging » Blog Archive » links for 2006-04-20 says

    […] Vitamin Features » Create your own Ajax effects (tags: javascript scriptaculous effects ajax) […]

  25. Fernando Lucas says

    Mitch, while I realize that the article does it’s job explaining how to create new effects, they’re not AJAX effects. They’re Javascript effects. I just wish great designers like Thomas himself would realise the mistake on the article title and help people separate pretty effects and ajax. They’re not exclusive to one another, as we know. I think that just wrapping everything under “AJAX” is not helpful for those starting out.

  26. Jono says

    Any tips on how to apply an effect like YFT without losing the current CSS styling on a textbox?

  27. Roy says

    Nice one Thomas!

    The beauty about your scriptaculous package is the ability to extend it but sadly not a lot of people have done that. Hopefully this is tutorial will act as the catalyst to get people into a scriptaculous extension frenzy.

    I was also surprised that there hasnt been any web standard zealot screaming murder for you using the innerHTML method before going into a spasm with froth coming out of their mouth.
    To them, ‘innerHTML’ is way worse than the F word , so is ‘eval’.

  28. Dr Nic says

    @Roy and/or @Thomas -
    What is it that is slanderous about innerHTML? It seems to be very syntactically clean - you have an element, and you want to insert some HTML into it.

  29. Roy says

    Dr Nic, Im not a web standard zealot by any stretch.
    You can spot one when he whines about “DOM promotes valid markup”, “DOM produces structured code”, “innerHTML not in the W3C spec” and “innerHTML is proprietary”.
    Ive nothing against innerHTML. In fact I use it all the time . My stance on it will most probably be the same as Dr Fuch’s.
    I use it when I need to simply dump a chunk of code into a DIV. But I do need to admit I feel just a little bit dirty doing that. DOM is just like the wife that youve been married to for 40 years, boring but proper. innerHTML is just like your hot sleazy latina fling, she tempting, she gets you what you want FAST but she’s “improper”.

    There are times when DOM method is preferable though such as when populating a table.

  30. Dennis Bullock says

    I am a noob to AJAX but think that this will put me well on my way. Good stuff.

  31. Edwin V. » Vitamin: voeding voor de webontwikkelaar says

    […] Vitamin is een nieuw online magazine met interessante artikelen voor webontwikkelaars. De artikelen zijn veel gericht op Web 2.0 aspecten zoals AJAX en Ruby on Rails. Een voorbeeld hiervan is het artikel van Thomas Fuchs over het maken van AJAX effecten in je web applicaties. […]

  32. Matt Todd says

    Thomas, thanks for that good look into Scriptaculous. I’ll be honest and say that I never gave it a second look when I heard that it was simply for visual affects: I’ve been using very simple Prototype affects (such as $(id).className = ‘hidden’; as a very, very simple example), but this really gives me a whole new domain to experiment with.

    I’ve been working on a project that can and will be using some very quiet and keen AJAX functionality, such as marking favorites and organizing them, and I believe that I may incorporate this into it.

    Again, this is a really great article because it introduced me (rather succintly) to a whole new world of interface design for me.

    Thanks again, and I look forward to more articles. Keep up the good work.

    M.T.

    P.S. — I’m not sure what all the hubbub about having ‘AJAX’ in the title is: I understood you perfectly that these effects would generally be out of place without some kind of AJAX operation being performed: it’s to handle the interface awareness for backend actions! Ah well, you can’t please them all, especially the loud ones!

  33. Joe says

    @Fernando Lucas,

    What is an AJAX effect anyway? Can you give an example of an effect that is strictly AJAX?

  34. Sam Felder says

    To change the subject a little bit, I am interested in seeing more articles like this. One thing we have been trying to do with little success is to use scriptaculous to drag list items between columns in a layout (for the interface purpose of rearranging the layout). This kind of manipulation has more of an obvious AJAX connection and would also come in very handy.

    Thanks again for this post though, I found it instructive.

  35. Bench says

    Ajax in my opinion is exactly like the Ajax soap. It will eventually dissolve because the effect, although it’s cool that you can drag stuff? It’s a useless cool effect.

  36. Dr Nic says

    @bench - I disagree. The ability to send requests back to the server to pass and receive data/html updates allows websites to act akin to desktop applications. That sort of power isn’t a fad.

  37. Fernando Lucas says

    @Joe - There isn’t such thing as an AJAX effect. AJAX is a way of getting XML data into HTML pages without having to reload them. Basically, AJAX makes it a lot faster - and maybe easier? - to update the content of a site in real time.

    An “AJAX Effect” is actually a Javascript effect. You see, Javascript is responsible for doing all the pretty stuff that we actually see as an effect, while AJAX brings us the data - the content.

  38. picture of Thomas Fuchs Thomas Fuchs says

    I like to compare “AJAX effects” to “car doors”. Sure, a door is not a car. But without doors, the car wouldn’t be too user friendly (of course, the car by itself doesn’t need doors). :)

  39. Guido says

    Wow man!

    I’m an AJAX begner and this is very helpful for me! Thx!

  40. Chris "Praying" Maness says

    Hey man this is awesome I realy appreciate what you all are doing.
    I dont know if this is even the right place to ask but I need a little more help with AJAX and DOM scripting. I built a page that doesn’t refresh but instead changes the visiblity of the section by changing the class it works great in IE but It won’t do anything in Firefox….Maybe I’m doing something wrong any sugestions?

  41. Barbablog » Adieu Jeffrey, bonjour Ryan says

    […] Create your own Ajax effects […]

  42. Randomizing /2 | Central Scrutinizer (en. vers.) says

    […] good. (everybody knows the previous “Web CSS Mashup“, however?) Play as MP3 | Permalink | // Used for showing and hiding user information in the comment form function ShowUtils(){ document.getElementById(”authorinfo”).style.display = “”; document.getElementById(”showinfo”).style.display = “none”; document.getElementById(”hideinfo”).style.display = “”; } function HideUtils() { document.getElementById(”authorinfo”).style.display = “none”; document.getElementById(”showinfo”).style.display = “”; document.getElementById(”hideinfo”).style.display = “none”; } […]

  43. Tony Bianco says

    I’m wanting to control the volume of an embedded media file based upon the position of the slider from the slider effect. But I can’t see to figure out how to set a default position at lets say 50 out of 100. How would I accomplish this with the slider demo?

  44. Gilberto says

    This is no AJAX. Boring.

  45. jeff says

    you really are a genius! thanks for such a fantastic library.

  46. Praveen says

    I have been trying to fade a HTML select element when there is an onchange event triggered. For some reason, when I have Effect.Fade(’div id’) in the onchange line, it works, but when I have an onchange event go to a function and there I do an Effect.Fade, it does not work in IE. Am I missing something? It works in Firefox like a charm but no luck in IE at all. Here is the code below: I would really appreciate it a lot if someone could tell me what I am doing wrong!

    Testing fade

    function FillSizes(oElem) {
    Effect.Fade(’gender_div’,{duration:2});
    }

    Just a simple test for fade using prototype and script
    Gender:

    Mens
    Womens
    Unisex

  47. Praveen says

    //
    Sorry for the repost, The HTML code which I posted earlier got translated and hence am trying it again:

    //
    //
    function FillSizes(oElem) {
    Effect.Fade(’gender_div’,{duration:2});
    Effect.Appear(’gender_div’);
    }
    //
    //
    //
    //Just a simple test for fade using prototype and script
    //Gender:
    //
    // Mens
    //Womens
    //Unisex
    //

  48. Keith says

    The code itself looks quite complicated. Personally, I don’t really fancy it since it isn’t much of a pure AJAX code, as most of the reviewer above have mentioned.

  49. reflexing says

    What about code highlighting in examples?

  50. Tobie says

    I can’t believe it…!

    Thomas has built a fantastic Javascript library based on Prototype. He has open-sourced it (with an extremely liberal license), has set-up a website and a really well documented wiki for it, takes the time for writing up a great tutorial on a little known aspect of script.aculo.us (the effects engine)… And all you guys are just bashing him up because his title doesn’t meet your definition of the word AJAX ?

    Come on!

    I’ll just take this opportunity to say thanks and thanks again…

    And by the way, I’ve been digging into Prototype and script.aculo.us for quite a while now… and this tutorial opened up a whole new creative perspective.

    Keep up the great work!

  51. Tobie says

    Just wondering how to extend script.aculo.us further to be able to write:

    $('total').cashRegister(150);

    rather than:

    new Effect.CashRegister('total',150);.

    Any ideas?

  52. Tobie says

    I’m really sorry, I meant:

    $('total').visualEffect('CashRegister', 150);

  53. michalkuklis.com Blog » Blog Archive » script.aculo.us mmmmm….. Effects says

    […] With script.aculo.us we’re able to build web components which look and behave like flash. It’s all about effects. Take a look on this post. There is also growing number of effects submitted by others here.  The good example of application which uses all juicy effects is here […]

  54. Lee Fastenau says

    Having pored over the lengthy debate about the name of this article, I find myself both surprised and worried. Surprised that nobody sufficiently explained some of the fundamental concepts and terminology that link these effects to AJAX, and worried that several novice AJAX developers/designers are walking away excited about AJAX, but possibly misinformed and certainly not armed to talk intelligently to their new found knowledge.

    I do agree with the sentiment that the more noise we hear about AJAX, the more challenging it becomes to talk to clients about it. They tend to develop some strange notions about what AJAX is and, more importantly, its value.

    I think Thomas did a fair job explaining why this particular effect is useful, but perhaps assumed a bit much about the audience. What absolutely needs clarification is why these types of effects are so strongly and almost generically coupled with AJAX or AJAXian client behavior. There… I’ve used one key word that hasn’t been mentioned in the article nor any of the ensuing debate despite its ubiquity in the world of standards-based design and the lexicon of Web 2.0: Behavior

    In fact, I strongly urge AJAX developers to start using the words “behavior” or “transition” and stop using the word “effect” to describe client UI behavior. It’s difficult enough convincing people of the usefulness of a transition or movement without labelling it something as superfluous as an “effect.”

    But that’s not enough. We still have to speak to the rationale behind these behaviors. “It looks cool” is not enough of a business case for most clients (at least, not the good paying ones). Thankfully, it’s as easy as saying that these behaviors give your AJAX responses context. Another key word notably absent from all of the above.

    These behaviors (fading, sliding, expanding, collapsing, exploding, and so forth) are necessary to provide visual context to whatever feedback an AJAX call returns. I’ve had much success (read buy in) describing it this way to business managers, systems architects, and even other UI designers.

    “Why does that section have to slide open like that? Is it just to look cool? We should really keep this simple.”

    “We’re using the sliding behavior because it helps to maintain the context of the items underneath that section. If it simply popped open, a user would have a difficult time locating that information again and may not even notice the new information if he or she happened to blink. Plus, it doesn’t hurt that it looks cool, right?”

    A couple other useful key words when talking about AJAX behaviors: intuitive and expressive (a wonderful term used liberally by Macromedia [now Adobe] at their MAX conference last year)

  55. The other side of the firewall » Create your own Ajax effects says

    […] http://www.thinkvitamin.com/features/ajax/create-your-own-ajax-effects […]

  56. Ajaxian » Thomas Fuchs - Combining Advanced JavaScript/DOM techniques to Enhance Use Experience says

    […] Fuchs has an article on creating your own effects at Vitamin […]

  57. aNieto2K » Article » Crea tus propios effectos says

    […] El feo de la camisa chunga nos cuenta como crear efectos ajax usando script.aculo.us… […]

  58. James McCarthy says

    Half of the comments seem to be splitting hairs over the symantics of the title, detracting from the value of the post and swamping valuable comments.

    The title says it all AJAX E F F E C T S geddit! These effects are more than icing on the AJAX cake.

    If the effect affects an appropriate response in the user job done.

    [Click] => ” I pressed a button and the spinner says it is doing something”

    [Fade deleted item] => “the thing I deleted is gone”

    Without these effects, the percieved inactivity of httpxmlrequest can cause frustration. Well thought out ways to keep the user informed are as valuable as the ajax call itself.

    Every action should have an equal an appropriate effect.

  59. » links for 2006-05-19 « marksdigital says

    […] Create your own Ajax effects (tags: effects scriptaculous javascript) […]

  60. Tobie says

    For the semantic freaks, Jonathan Snook just wrote an excellent article on the distinction between AJAX and Ajax.

  61. Blergh » links for 2006-05-26 says

    […] Vitamin Features » Create your own Ajax effects (tags: ajax javascript scriptaculous effects tutorial prototype UI howto prototype.js) […]

  62. Theodor Zoulias says

    Prototype is evil. Commits the sin of all sins, extending the Object prototype, polluting JavaScript’s global namespace in the most hideous and insidious way possible. Prototype plays well with Prototype, is hostile to any other piece of js code. Prototype is UnJavaScript. I don’t like to extend it, to include it in my projects, to see it or to smell it. Anything built on Prototype is non existent for me.

  63. Chris says

    Hate to spoil the party and post a positive comment, but just wanted to thank you for clearing up the syntax for callbacks.

  64. Marcus says

    dlsldkajfaf;

  65. Crea il tuo effetto ajax - sastgroup.com says

    […] <div onclick="Effect.Fade(this,{duration:3})">Fade me slower!</div>  Continua a leggere su http://www.thinkvitamin.com/…create-your-own-ajax-effects Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. […]

  66. A .NET pontja körül » 60 AJAX tutorial-t says

    […] Create Your Own Ajax Effects Why let script.aculo.us have all the fun? Start building your own Ajax-driven visual effects today. The basic and prebuilt effects in script.aculo.us are nice, but if you really want to build something great why not investigate doing your own, homegrown, do-it-yourself effects. We’re going to show you how to take basic effects and build on them to create your own. […]

  67. AJAX vs Ajax and Ajax Effects - davecentral Planet David Central & Dave Central Planet says

    […] Now, if you feeling like making your own Ajax Effects, check out Thomas Fuchs’ Vitamin article. […]

  68. Diviner says

    Thank you. It is very useful for me.

  69. Ron says

    Check out http://www.planjam.com/date.php

    The site relies heavily on AJAX and Prototype while doing an excellent job with many aspects of the script.aculo.us library.

  70. Top 126 Ajax Tutorials : Ultimate Web Developer Lists : eConsultant says

    […] Create Your Own Ajax Effects : animated text; at ThinkVitamin […]

  71. Jes says

    My God!

  72. Jack says

    What a great article. Now that I know how easy it is to make effects the options are limitless. This took under an hour including the time taken to read the above article:
    http://www.okodev.com/typewritter_effect/

    Thanks Thomas!

  73. Craig Mackenzie says

    Great intro into extending script.aculo.us, just what i was looking for this is going to be very very usefull, thank you very much Thomas, and congrats on Gucci.

  74. adflkdfkl says

    dfjkdfkdjfkjdfk

  75. Jack says

    What do you think about the spry things from adobe

  76. jeff says

    1000 people speaking around - 1 german working

    Has anybody something to bring to the work of Mr Fuchs,
    since 3 months I only see followers applying the ajax development of Thomas Fuchs, inclusive the guys at Adobe (shame on them).

    I don’t have the level to make it, but if I could, I would not spend so much time blogging but developping.

  77. picture of Thomas Fuchs Thomas Fuchs says

    Jeff: I’m from Austria :)

  78. jeff says

    Sorry Thomas,
    I apologize sincerely

  79. jeff says

    I would like to hear from you Thomas what you think about a framework “entwickeln” from an old typography house that use non compliant tags, if you know what I mean

  80. glen says

    What is the “script.aculo.us” ?Is it a ajax framework just like sajax?

  81. Kiran Soumya says

    Thomas!

    ur work is superb and very much helpful to all of us.

    Thanks … Thanks a lot!

  82. All Cusco | Blog » Blog Archive » Top - 126 tutoriales Ajax says

    […] Create Your Own Ajax Effects : animated text; at ThinkVitamin […]

  83. Ajax Tutorials « Blooming Webs says

    […] Slide Show with Controls at ZapatecCreate Your Own Ajax Effects animated text; at ThinkVitamin Make all your tables sortable at Kryogenix Ajax Design Patterns at Snyke […]

  84. the spelling and grammar police says

    it’s “convenience”, and “get’s” does not require an apostrophe.

  85. Javier Cabrera says

    Hi Thomas; do you or anyone here knows how to do a GENIE MacOS effect with Ajax? is that possible?

  86. anfiopy says

    Excellent site, added to favorites!!

  87. H.G.M. Blog » Blog Archive » Helpful tutorials to learn Ajax. says

    […] Create Your Own Ajax Effects : animated text; at ThinkVitamin […]

  88. John C says

    Thanks for the tips!

  89. Ajax Girl » Huge list of Ajax tutorials says

    […] Create Your Own Ajax Effects animated text; at ThinkVitamin […]

  90. gary says

    The company I have been working for, Knowledgestorm.com has been researching and diving in head first with AJAX. There is a java library that integrates very smoothly with spring if you are interested. It is called DWR. It is what we are using for dynamic forms and it helps to increase conversion rates to keep a user on the page.

    Hope that helps some of you looking for that type of library,

    Gary
    http://www.liquid-vitamins-complete.com

  91. archie says

    I think it is a great idea to use Ajax from know on..

  92. Huge list of Ajax tutorials at readxml says

    […] Create Your Own Ajax Effects animated text; at ThinkVitamin […]

  93. Bush says

    You have a wonderful website here. May God rich bless you always.n

  94. juan barek says

    RADIO LOGOS NETWORK Organizacion Internacional de Radio, como respuesta a la necesidad de anunciar mensajes de inspiracion en general a millones de hispano hablantes.
    en toda Europa , Iberoamerica, el Caribe y el Norte de África .Desde entonces, ha enriquecido las programaciones de más de un centenar de emisoras por todo el mundo.

    ConPoder Radio.- Ahora mientras navegas por nuestro sitio puedes escuchar nuestra Radio On Line. Nuestro objetivo es llegar a los oyentes de habla hispana con una programación enteramente cristiana que llene las espectativas de nuestros visitantes.

  95. Nogz Blogz 3.4 » Turbo Linkdumping: Ajax Developers Edition… says

    […] Vitamin Features » Create your own Ajax effects […]

  96. ajaxlines says

    Here, you can find full reviews about this article …

  97. alaa.moustafa says

    I found useful article talking about Ajax Efftects. I want to share it with you …

    Ajax vs Ajax Effects

  98. » 100 Ajax Tutorials and Resources - Photoshop Tutorial - The Tutorial Blog says

    […] Create your own Ajax effects […]

  99. Elehu says

    Cool

  100. r34l says

    Awesome stuff :)

  101. hongbiao says

    This is so intuitive!
    And I love the simplicity of the example code.
    Thanks Thomas!

  102. NN says

    I need to implement embeded transactions.
    DoJo Vs script.aculo.us. What is best AJAX framework to use? Any suggestions.

  103. wer says

    twttestsets

  104. Ajax para tu web!! » |KENAVIK | BLOG says

    […] Create your own Ajax effects […]

  105. viiagra says

    Hi!
    Funny site.
    viiagra
    Thanks.

  106. emil says

    I would classify this article DOM, not AJAX

  107. SachinKRaj - get something useful from web 100 AJAX & JavaScript Tutorials « says

    […] Create your own Ajax effects […]

  108. Tutorials « Kunal Vijan says

    […] Create your own Ajax effects […]

  109. AJAX Widgets and Tutorials « SKRaghav-Moves with Latest Updates says

    […] Create your own Ajax effects […]

  110. The Blog for DesignCreatology » Blog Archive » Free AJAX Tutorials says

    […] Create Your Own Ajax Effects Why let script.aculo.us have all the fun? Start building your own Ajax-driven visual effects today. The basic and prebuilt effects in script.aculo.us are nice, but if you really want to build something great why not investigate doing your own, homegrown, do-it-yourself effects. We’re going to show you how to take basic effects and build on them to create your own. […]

  111. Tutorials » Blog Archive » :: 146 Ajax Tutorials says

    […] Create Your Own Ajax Effects : animated text; at ThinkVitamin […]

  112. Bleebot | Christophe Lefevre » + de 140 tutos Ajax says

    […] Create Your Own Ajax Effects : animated text; at ThinkVitamin […]

  113. Brocante says

    Tres bon site sur l ajax
    Merci

  114. sastgroup.com » Blog Archive » Tutorials su ajax says

    […] Create Your Own Ajax Effects : animated text; at ThinkVitamin    […]

  115. Il blog sul php » Tutorials su ajax says

    […] Create Your Own Ajax Effects : animated text; at ThinkVitamin    […]

  116. Buzzlair says

    ive been learning ajax for the whole 5 months n neva figure out the exact picture. arghh… any idea? maybe i have to eat more carrot so i can be smart about this. neway, thomas, such a great article

  117. Big List Of More AJAX Tutorials says

    […] Create Your Own Ajax Effects Why let script.aculo.us have all the fun? Start building your own Ajax-driven visual effects today. The basic and prebuilt effects in script.aculo.us are nice, but if you really want to build something great why not investigate doing your own, homegrown, do-it-yourself effects. We’re going to show you how to take basic effects and build on them to create your own. […]

  118. sainsburys-shopping.buyartworkonline says

    […] […] fantastic site now brush up this column http://www.thinkvitamin.com/features/ajax/create-your-own-ajax-effects and give comments […] […]

  119. FatherStorm says

    Well, I’ve seen a lot of comments in here that this isn’t AJAX.. as far as I’m concerned, it is, insofar as it is most ideally used in a page that USES ajax. the AJAX, would make the DB updates to the order temp table (or some similar) then the effect would update the price field alone. Definitely useful. Due to clients wanting their back-button, I’m not using very much in the way of AJAX, but I’m firing this on page load with the “old” and new cart totals. I DID have to change the script just a touch to have it accept the old total as a variable, but it works beautifully. thanks for the code.

  120. google reklam says

    thanks

  121. 100 Ajax Tutorials and Resources | ::: Ayiva ::: says

    […] Create your own Ajax effects […]

  122. manicwave.com » Blog Archi