用JScript實現MembersTable

在msdn online上講解某個類的屬性、方法、事件時,用到了一個MembersTable的表格。類似下圖:


筆者研究其中的代碼,經過簡化也實現了這種效果,提供類似如下的 TABLE,通過JScript,能夠自動生成類似上圖的MembersTable:

<BLOCKQUOTE>
  <DIV id=oMTExplanation style="DISPLAY: none"></DIV>
  <DIV id=oMT>
    <P class=clsRef style="DISPLAY: none">屬性</P>
    <DIV tabName="屬性">
      <TABLE class=clsStd style="BACKGROUND: #ffffff" width="100%">
        <TBODY><TR>
          <TH>屬性</TH>
          <TH>說明</TH>
        </TR>
        <TR>
          <TD>
            <NOBR>
              <A href="#">image</A>
            </NOBR>
          </TD>
          <TD>
            Sets or retrieves the DirectAnimation Image (DAImage class) displayed by the <B>anim:DA</B> element.
          </TD>
        </TR>
        <TR>
          <TD>
            <NOBR>
              <A href="#">sound</A>
            </NOBR>
          </TD>
          <TD>
            Sets or retrieves the DirectAnimation sound (<B>DASound</B> class) played by the <B>anim:DA</B> element.
          </TD>
        </TR>
        <TR>
          <TD>
            <NOBR>
              <A href="#">statics</A>
            </NOBR>
          </TD>
          <TD>
            Retrieves an object containing the <B>DAStatics</B> class library used with DirectAnimation.
          </TD>
        </TR>
      </TBODY></TABLE>
    </DIV>
 
    <P class=clsRef style="DISPLAY: none">方法</P>
    <DIV tabName="方法">
      <TABLE class=clsStd style="BACKGROUND: #ffffff" width="100%">
        <TBODY><TR>
          <TH>方法</TH>
          <TH>說明</TH>
        </TR>
        <TR>
          <TD>
            <NOBR>
              <A href="#">addDABehavior</A>
            </NOBR>
          </TD>
          <TD>
            Adds a DirectAnimation behavior (DABehavior class) to the run list when the behavior is not part of the animation model.
          </TD>
        </TR>
        <TR>
          <TD>
            <NOBR>
              <A href="#">removeDABehavior</A>
            </NOBR>
          </TD>
          <TD>
            Removes a DirectAnimation behavior (DABehavior class) added by the <B>addDABehavior</B> method.
          </TD>
        </TR>
      </TBODY></TABLE>
    </DIV>
  </DIV>
</BLOCKQUOTE>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章