Synchronized parallel execution of effects : Effect « Scriptaculous « JavaScript DHTML






Synchronized parallel execution of effects

 
<html>
<head>
<title>Untitled Document</title>

<script src="scriptaculous-js-1.8.2/lib/prototype.js" type="text/javascript"></script>
<script src="scriptaculous-js-1.8.2/src/scriptaculous.js" type="text/javascript"></script>
<script src="scriptaculous-js-1.8.2/src/unittest.js" type="text/javascript"></script>

<script type="text/javascript">
Event.observe(window, 'load', function() {
  $('demo').observe('click', function() {

    new Effect.Parallel([
      new Effect.Opacity('demo', { sync: true, from: 1, to: 0.33 }),
      new Effect.Scale('demo', 400, { sync: true, scaleFromCenter: true })
    ], { duration: 20 });

  });
});

</script>

</head>
<body>

<p id="demo">Click on this paragraph to have a demonstration of it.</p>

</body>
</html>

   
  








Related examples in the same category

1.Effect.Queue limit
2.Start queued effects in global queue
3.Random effects demo