【发布时间】:2015-08-11 09:29:34
【问题描述】:
您好,我正在尝试在 AEM 中使用视觉设计一个手风琴组件,我们在客户端库下编写 html 代码以及用于 css 和 js 的不同文件,而不是 jsp。
我只是编写了下面的编写部分并编写了相同的 js,但看不到任何更改...有人可以为我提供实现相同的解决方案.. ->当我单击显示 parsys 部分时打开,当显示转换为隐藏时,当我单击隐藏时 parsys 部分关闭并隐藏转换为显示。
<div data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}" data-sly-unwrap>
<css data-sly-call="${clientLib.css @ categories=['sd-singtel.accordion_2']}" data-sly-unwrap/>
<js data-sly-call="${clientLib.js @ categories=['sd-singtel.accordion_2']}" data-sly-unwrap/>
</div>
<div data-sly-test="${wcmmode.edit}">Accordion_2 component</div>
<div class="about-contentcontainer">
<div class="about-content">
<div class="awards">
<h4> <a href="javascript:void(0);"><span class="more">Show</span></a></h4>
<h4> <a href="javascript:void(0);"><span class="more expanded">Hide</span></a></h4>
</div>
</div>
</div>
<script>// <![CDATA[
$(document).ready(function() {
alert("Hello");
$(".awards h4 a").click(function() {
enter code here
$(this).parent().next().slideToggle("slow");
var htmlStr = $(this).find(".more").html();
if (htmlStr == "Show") {
$(this).find(".more").html("Hide");
$(this).find(".more").addClass("expanded");
} else {
$(this).find(".more").html("Show");
$(this).find(".more").removeClass("expanded");
}
});
});
// ]]></script>
【问题讨论】: