div标签以使用xslt在扩展上显示和隐藏在折叠上 [英] div tag to show on expand and hide on collapse usi ng xslt
问题描述
我有一个Webpart上的超链接列表,我想在每个链接旁边显示一个加号,当我单击该链接时,它应该展开并想要显示说明,当我单击-ve时,它应该显示崩溃,说明应隐藏.我如何使用xslt实现此目的.请给我一些建议.让我知道是否不清楚.
I have list of hyperlinks on a webpart and i would like to show a plus sign next to each link and when i click on it should expand and would like to show the description and when i click on the -ve sign it should collapse and description should be hidden. How can i acheive this using xslt. Plz privide me some suggestions. Let me know if something is not clear.
谢谢
推荐答案
正如Dimitre所述,我不确定xslt与此相关,但这是jquery:
As Dimitre mentioned, I'm not sure what xslt has to do with this, but here's the jquery:
<style type="text/css">
.description { display: none; }
</style>
<div class="title" id="fruits">Fruits <span class="expand">+</span></div>
<div class="description" id="fruits_desc">
Fruits are nutritious.
</div>
<script type="text/javascript">
$('.title .expand').click(function() {
var expander = $(this);
var selectedID = $(this).parent().attr('id');
var desc_id = '#'+selectedID+'_desc';
$(desc_id).toggle(function() {
$(desc_id).show();
$(expander).html('-');
}, function() {
$(desc_id).hide();
$(expander).html('+');
}); // toggle
}); // click
</script>
xslt只是转换了XML文件,我认为呢?有一个jquery库(google'jquery xslt'),您可以在这里用.html('')和.html([从ajax位置加载从xml中提取数据的ajax位置)替换hide()和show()功能. xslt转换的文件]]
xslt just transforms xml files I think? There's a jquery library for that (google 'jquery xslt') and you might replace the hide() and show() functionality here with .html('') and .html([ajax place to load data from which pulls from an xml file transformed by xslt])
这篇关于div标签以使用xslt在扩展上显示和隐藏在折叠上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!