miércoles, 6 de junio de 2012

YUI 2: Test Panel con Eventos

var panel;

function init() {
    // Instantiate a Panel from markup
    panel  = new YAHOO.widget.Panel("panel1", { 
                width:"320px", 
                visible:false, 
                constraintoviewport:true 
              });

    panel.render();

    YAHOO.util.Event.addListener("show1", "click", panel.show, panel, true);
    YAHOO.util.Event.addListener("hide1", "click", panel.hide, panel, true);

    panel.subscribe("beforeShow", function(){
        console.log("antes de renderizar panel");                
    });

}

YAHOO.util.Event.addListener(window, "load", init);

http://jsfiddle.net/zNF4B/
cheatsheet

No hay comentarios:

Publicar un comentario