小编sir*_*und的帖子

当ID具有使用jQuery的类时显示内容

我正在尝试创建一系列资源框,这些资源框将作为图像和标题显示在页面上.

带有标题的图像

选择(单击)图像(资源)时,将显示包含资源简要描述的下拉框,以及用于获取更多信息的按钮.

出现更多信息选项

再次单击资源时,它将显示资源的完整描述,以及两个按钮:一个用于删除信息,另一个用于较少信息.

编辑媒体信息

我已经使用XSLT根据用户输入资源时提供的XML为每个资源选择内容.

XSLT:

<div id="newContainer">
<div class="hidden">
<xsl:value-of select="/Properties/Data/Group[@Name='Header']/Datum[@Name='Title']"/>
</div>
    <ul id="initialContent">
        <xsl:for-each select="/Properties/Data/Group[@Name='List Item']">
            <li>
                <xsl:attribute name="class">
                    <xsl:value-of select="Datum[@Name='Title']"/>
                </xsl:attribute>
                <a href="#">                
                        <img>
                            <xsl:attribute name="src">
                                <xsl:value-of select="Datum[@Name='Source']"/>
                            </xsl:attribute>
                            <xsl:attribute name="alt">
                                <xsl:value-of select="Datum[@Name='Alt']"/>
                              </xsl:attribute>                      
                        </img>  
            <xsl:value-of select="Datum[@Name='Title']"/>   
                </a>
            </li>
        </xsl:for-each>
    </ul>
</div>
<div id="briefDescription">
<xsl:if test="@class=Datum[@Name='Title']">
     <xsl:for-each select="/properties/Data/Group[@Name='List Item']">
        <a>         
        <xsl:value-of select="Datum[@Name='Description']"/>
        <xsl:value-of select="normalize-space(substring(title,1,50))" disable-output-escaping="yes"/>
    <xsl:if test="string-length(title) &gt; 50">..</xsl:if>         
        </a>
    </xsl:for-each>
</xsl:if>
</div>
Run Code Online (Sandbox Code Playgroud)

XML:

<Data>
<Datum Exposed="true" ID="ResourceTitle" Name="Title" Type="String">Title</Datum>
<Group Exposed="true" ID="Resource" Name="List Item" Replicatable="true">
<Datum Exposed="true" …
Run Code Online (Sandbox Code Playgroud)

html xml xslt jquery

11
推荐指数
1
解决办法
1373
查看次数

标签 统计

html ×1

jquery ×1

xml ×1

xslt ×1