Sophomore Dev Projects

  • Increase font size
  • Default font size
  • Decrease font size
Home

Y.Effects.Puff

E-mail Print PDF

Gives the illusion of the element puffing away (like a in a cloud of smoke).

Syntax

new Y.Effects.Puff({ node: "#node" });

Y.get("#node").puff();

Configuration properties

None.

Notes

None.

Demo

Source code of this demo

  
    
   
    <ul>
      <li><a id="puff_run" href="#">Click here for a demo!</a></li>
      <li><a id="puff_reset" href="#">Reset</a></li>
    </ul>
 

  <script type="text/javascript">
    YUI({
      modules: {
        "gallery-effects": {
          fullpath: "http://projects.sophomoredev.com/media/system/js/yui3-gallery/gallery-effects/gallery-effects.js",
          requires: ["node", "anim", "async-queue", "base"]
        }
      }
    }).use("gallery-effects", function (Y) {
    
      Y.get("#puff_run").on("click", function (event) {
        Y.get("#puff_demo").puff();
    
        event.halt();
      });
    
      Y.get("#puff_reset").on("click", function (event) {
        Y.get("#puff_demo").setStyles({
          display: "block",
          opacity: 1,
          width: "80px",
           height: "80px"
        });
    
        event.halt();
      });
    
    });
  </script>