Loading ...
Sorry, an error occurred while loading the content.

Dynamic DIV

Expand Messages
  • ---
    Hi. I want to make a menu like the star Windows Menu, and when I click on any option I want to create dynamically a window. The idea that I supose is create a
    Message 1 of 2 , Apr 2, 2007
    • 0 Attachment
      Hi.

      I want to make a menu like the star Windows Menu, and when I click on
      any option I want to create dynamically a window.

      The idea that I supose is create a DIV inside a big window content
      region and then make it draggable.

      But I no have idea to create objets dynamycally using the YUI.

      Please help me.
    • John A. Vieth
      I m a beginner, too, so this might not be the best option, but it occurred to me that you might dynamically create the divs by updating the .innerHTML property
      Message 2 of 2 , Apr 3, 2007
      • 0 Attachment
        I'm a beginner, too, so this might not be the best option, but it occurred to me that you might dynamically create the divs by updating the .innerHTML property of some parent div.  This is done using YUI's DOM utility and partly just with old-fashioned JavaScript/DOM.  Use YUI's DOM utility to get the element that is the parent div.  Then re-write the innerHTML property by setting it equal to new HTML, which includes your new DIV, like this.

        var oParentDiv = YAHOO.util.Dom.get("parentdiv");
        oParentDiv.innerHTML = '<div id="newchilddiv">Content for new DIV goes here!</div>';

        ...or I suppose that, after you get the parentdiv, instead of re-writing the innerHTML, you could instead add a child node using Yahoo! UI's DOM utility.  I'm not sure which is the "proper" solution, but either should work.

        Good luck.

        - John

        ----- Original Message ----
        From: --- <odiel@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Monday, April 2, 2007 11:06:14 PM
        Subject: [ydn-javascript] Dynamic DIV

        Hi.

        I want to make a menu like the star Windows Menu, and when I click on
        any option I want to create dynamically a window.

        The idea that I supose is create a DIV inside a big window content
        region and then make it draggable.

        But I no have idea to create objets dynamycally using the YUI.

        Please help me.


      Your message has been successfully submitted and would be delivered to recipients shortly.