本文介绍了Jquery根据折叠位置翻转箭头图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
刚刚从朋友那里继承了代码,这里是
Just inherited code from a friend and here it is
<ItemTemplate>
<div style="margin: 30px 0 10px 30px;">
<a runat="server" id="Anchor" />
<div class="question">
<div style="width:80%;height:auto; float:left;" data-toggle="collapse">
<p style="font-size:large;"><asp:Literal runat="server" ID="Question" /></p>
</div>
<div style="width:20%; height:auto; float:right;">
<span class="fa fa-angle-down"></span>
</div>
</div>
<div class="answer" style="display: inline-block;"><asp:Literal runat="server" ID="Answer" /></div>
</div>
<script type="text/javascript">
$(document).ready(function ()
{
$('div.answer').hide();
$('div.question').click(function ()
{
var $question = $(this);
if ($question.hasClass('selected-question')) return;
$('div.selected-question').next().slideUp(function ()
{
$(this).prev().removeClass('selected-question');
});
var $answer = $question.addClass('selected-question').next();
$answer.slideDown();
});
});
</script>
我的尝试:
我已经使div扩展但我无法崩溃
What I have tried:
I've made the div to expand but i'm not able to collapse back
推荐答案
这篇关于Jquery根据折叠位置翻转箭头图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!