I have a view control and a toggle div, on click of view i need to expand the toggle. which means toggle should be expanded by default on view click. Please help.
function ViewFile() {
$('#contentDiv').slideToggle();
}
When I click on View Record, I will get the Sample Record enabled.When i click on the Sample records , the toggle is happening. But my requirement is when i click on View Record, I need the toggle in the expanded format by default.
I don't know how to expand the toggle on click of view records.
chaaru_akila...
Member
3 Points
11 Posts
Jquery expand and collapse
Nov 28, 2012 12:38 PM|LINK
Hi ,
I have a view control and a toggle div, on click of view i need to expand the toggle. which means toggle should be expanded by default on view click. Please help.
Thank you.
DarrellNorto...
All-Star
86555 Points
9624 Posts
Moderator
MVP
Re: Jquery expand and collapse
Nov 28, 2012 01:16 PM|LINK
See this sample:
http://www.aspxtutorial.com/post/2010/11/06/Expand-collapse-div-using-jQuery.aspx
Or post your code and what problem you are having.
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
RameshRajend...
Star
7983 Points
2099 Posts
Re: Jquery expand and collapse
Nov 28, 2012 01:18 PM|LINK
http://www.webresourcesdepot.com/jquery-collapse-expanding-collapsing-content-with-javascript/
http://stackoverflow.com/questions/10478269/jquery-expand-and-collapse
chaaru_akila...
Member
3 Points
11 Posts
Re: Jquery expand and collapse
Nov 28, 2012 01:35 PM|LINK
My View record link
<a id="viewFile" href="#" onclick="ViewFile()"> View File</a>
div with records
<div id="divSampleRecords" runat="server" style="display: none;">
<a href="#" onclick="ViewFile()" style="font-size: 11px; font-weight: bold;">+ Sample
Records</a>
<div id="contentDiv" style="height: 50px; border: solid 1px #dbdbdb; display: none;">
<asp:TextBox ID="txtRecords" runat="server" Style="font-size: 12px; color: #666666;
width: 100%; height: 50px;" TextMode="MultiLine" ReadOnly="true"></asp:TextBox>
</div>
</div>
Toggle Function.
function ViewFile() {
$('#contentDiv').slideToggle();
}
When I click on View Record, I will get the Sample Record enabled.When i click on the Sample records , the toggle is happening. But my requirement is when i click on View Record, I need the toggle in the expanded format by default.
I don't know how to expand the toggle on click of view records.
Hope this helps,
Thanks.
aamirha
Member
677 Points
170 Posts
Re: Jquery expand and collapse
Nov 30, 2012 05:27 AM|LINK
The following link will provide you the solution and live demo.
Expand collapse multi div using jQuery - Part -2
Fill ASP.NETDropdownlist through JSON data using jQuery