script.aculo.us - Grow 增大效果
说明
此效果给人一种缩小物体的感觉。物体从小点开始增大,形成完整的物体。
语法
您可以使用以下两种形式之一来使用此效果 −
new Effect.Grow('id_of_element', [options]); OR new Effect.Grow(element, [options]);
效果特定参数
此效果除了通用参数外,没有任何其他参数。
示例
<html> <head> <title>script.aculo.us examples</title> <script type = "text/javascript" src = "/javascript/prototype.js"></script> <script type = "text/javascript" src = "/javascript/scriptaculous.js?load = effects"></script> <script type = "text/javascript"> function GrowEffect(element){ new Effect.Grow(element, {duration:3}); } </script> </head> <body> <div id = "myimage" onclick = "GrowEffect(this);"> <img src = "/images/scriptaculous.gif" alt = "script.aculo.us" /> <h2>Click me to see Grow Effect</h2> </div> </body> </html>
这将产生以下结果 −