View Single Post
  #1 (permalink)  
Old June 26th, 2009, 04:21 PM
smys123 smys123 is offline
Authorized User
Points: 81, Level: 1
Points: 81, Level: 1 Points: 81, Level: 1 Points: 81, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Jun 2007
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hide/Show Template

currently I have it set up like this:

Code:
<xsl:template match="enrollment_list"> 
<script language="JavaScript" src="js/motionpack.js"></script>   
    <script type="text/javascript">
    function viewIt(){
        
        document.getElementById('coursesList').style.display = 'block';
        document.getElementById('coursesList').style.visibility = 'visible';
        document.getElementById('coursesList').style.height = '100%';        
    }
    </script>
    <tr>
     <td>
      <table cellspacing="0" cellpadding="2" border="0">
         <tr>
         <td><font class="uportal-channel-strong">
         <xsl:value-of select="title"/>
         </font>
          &nbsp;-&nbsp;<a href="#" onclick="viewIt()">View</a> 
         <br/></td>
         </tr>
         <xsl:apply-templates select="empty"/>         
         <xsl:apply-templates select="enrollment"/>
      </table>
     </td>
    </tr>
</xsl:template>

<xsl:template match="enrollment">
    <script type="text/javascript">
        document.getElementById('coursesList').style.display = 'none';
        document.getElementById('coursesList').style.visibility = 'hidden';
        document.getElementById('coursesList').style.height = '0px';
    </script>
    <tr>
     <td id="coursesList">
      <font class="uportal-channel-text">
      &bullet; <a href="{lctxt/href1/@newLink}" target="_blank"><xsl:value-of select="lctxt/text1"/></a>
      </font>
     <img src="{$imagepath}/transparent.gif" border="0" height="10" width="5"/> 
     <img src="{$imagepath}/transparent.gif" border="0" height="10" width="5"/> 
     <xsl:for-each select="icon">
     <a href="{href/@newLink}" target="_blank">
       <img src="{$webCtServer}{src}" border="0"/>
     </a>
     <img src="{$imagepath}/transparent.gif" border="0" height="10" width="5"/> 
     </xsl:for-each>
     </td>
    </tr>
</xsl:template>
in the enrollment template it basically builds a link for each course the person is in. however the way i currently have it, it only hides the first course in the list, the rest are visible.

Any Thoughts? Basically I would like to toggle hide/show the whole list.

Thanks in advance
Aaron
Reply With Quote