TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Adhikar Patil
NA
481
130.1k
How to collapse and expand menu
Jun 9 2018 8:22 AM
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title>Admin</title>
<link href=
"https://fonts.googleapis.com/css?family=Montserrat"
rel=
"stylesheet"
/>
<link href=
"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
type=
"text/css"
rel=
"Stylesheet"
/>
<link href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel=
"Stylesheet"
type=
"text/css"
/>
<link rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"
/>
<link href=
"Css/Style.css"
type=
"text/css"
rel=
"Stylesheet"
/>
<%-- <link href=
"http://code.jquery.com/jquery-1.10.2.min.js"
/>--%>
<script type=
"text/javascript"
src=
"http://code.jquery.com/jquery-1.10.2.min.js"
></script>
<script type=
"text/javascript"
language=
"javascript"
>
function
CourseCheck() {
var
aa = document.getElementById(
"collapseCourse"
);
alert(
'Hey div1 called !'
);
}
function
check1() {
document.getElementById(
"collapseCourse"
).setAttribute(
"class"
,
"panel-collapse collapse in divbgcolor"
);
return
;
}
</script>
<script type=
"text/javascript"
>
window.onload =
function
() {
check1();
}
</script>
<style type=
"text/css"
>
.accordion ul li a:not(.collapsed) .rotate-icon
{
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
.accordion .fa-angle-down
{
float
: right;
}
.panel-collapse ul li a
{
color: Black !important;
}
.divbgcolor
{
background-color: #F1F1F1;
}
.panel-collapse ul li
{
padding-top: 10px;
padding-left: 20px;
border-bottom: solid 1px black;
padding-bottom: 10px;
}
.accordion ul
{
margin-bottom: 0px !important;
}
.pull-left
{
float
: left;
}
.anchorclick
{
}
</style>
<asp:ContentPlaceHolder ID=
"head"
runat=
"server"
>
</asp:ContentPlaceHolder>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div
class
=
"col-lg-2 noleftpadding"
>
<div
class
=
"leftbox"
>
<div
class
=
"lefttop"
>
<img src=
"Img/logo.png"
/>
</div>
<div
class
=
"Leftmenu"
>
<div
class
=
"accordion"
>
<ul
class
=
"list-unstyled"
>
<li><a href=
"Default.aspx"
><i
class
=
"fa fa-dashboard"
></i>Dashboard</a></li>
</ul>
<asp:Panel ID=
"pnlCourse"
runat=
"server"
Visible=
"false"
>
<ul
class
=
"list-unstyled"
>
<li><a data-toggle=
"collapse"
data-parent=
"#accordion"
href=
"#collapseCourse"
id=
"colaps1"
runat=
"server"
aria-expanded=
"false"
aria-controls=
"collapseCourse"
>Manage Courses
<i
class
=
"fa fa-angle-down rotate-icon marginright20"
></i></a></li>
</ul>
<div id=
"collapseCourse"
class
=
"panel-collapse collapse divbgcolor"
runat=
"server"
>
<div>
<ul
class
=
"list-unstyled"
>
<li><a href=
"Manage-Course.aspx"
class
=
"anchorclick"
id=
"mgCourse"
runat=
"server"
onclick=
"return CourseCheck()"
><i
class
=
"fa fa-edit"
></i>Manage Courses</a></li>
<li><a href=
"Manage-Module.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-briefcase"
></i>
Manage Module</a></li>
<li><a href=
"Manage-Topic.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-newspaper-o"
></i>
Manage Topic</a></li>
<li><a href=
"Manage-Videos.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-video-camera"
></i>
Manage Videos</a></li>
<li><a href=
"Manage-Questions.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-question-circle-o"
>
</i>Manage Questions</a></li>
<li><a href=
"Manage-Package.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-question-circle-o"
>
</i>Manage Package</a></li>
<li><a href=
"Manage-Renewal.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-recycle"
></i>Manage
Renewal</a></li>
<li><a href=
"Referal-Program.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-list"
></i>Referal
Program</a></li>
</ul>
</div>
</div>
<ul
class
=
"list-unstyled"
>
<li><a data-toggle=
"collapse"
data-parent=
"#accordion"
href=
"#collapseContent"
id=
"colaps2"
class
=
"collapsed"
aria-expanded=
"false"
aria-controls=
"collapseContent"
runat=
"server"
>
Manage Content <i
class
=
"fa fa-angle-down rotate-icon marginright20"
></i></a>
</li>
</ul>
<div id=
"collapseContent"
class
=
"panel-collapse collapse divbgcolor"
runat=
"server"
>
<div>
<ul
class
=
"list-unstyled"
>
<li><a href=
"Manage-FAQ.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-question-circle-o"
>
</i>Manage FAQ</a></li>
<li><a href=
"Manage-Blog.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-question-circle-o"
>
</i>Manage Blog</a></li>
<li><a href=
"Manage-Book.aspx"
class
=
"anchorclick"
><i
class
=
"fa fa-question-circle-o"
>
</i>Manage Book</a></li>
</ul>
</div>
</div>
<ul
class
=
"list-unstyled"
>
<li><a href=
"Manage-User.aspx"
><i
class
=
"fa fa-user"
></i>Manage User</a></li>
</ul>
<ul
class
=
"list-unstyled"
>
<li><a href=
"Manage-Discount.aspx"
><i
class
=
"fa fa-list"
></i>Manage Discount</a></li>
</ul>
</asp:Panel>
<asp:Panel ID=
"pnlLMS"
runat=
"server"
Visible=
"false"
>
<ul
class
=
"list-unstyled"
>
<li><a data-toggle=
"collapse"
data-parent=
"#accordion"
href=
"#collapseLMS"
id=
"colaps3"
class
=
"collapsed"
aria-expanded=
"false"
aria-controls=
"collapseLMS"
runat=
"server"
>
Manage LMS <i
class
=
"fa fa-angle-down rotate-icon marginright20"
></i></a></li>
</ul>
<div id=
"collapseLMS"
class
=
"panel-collapse collapse divbgcolor"
runat=
"server"
>
<div>
<ul
class
=
"list-unstyled"
>
<li><a href=
"Manage-LMSUser.aspx"
><i
class
=
"fa fa-question-circle-o"
></i>Manage LMS
</a></li>
<li><a href=
"EnquiryInformation.aspx"
><i
class
=
"fa fa-question-circle-o"
></i>Enquiry
Details</a></li>
<li><a href=
"CustomerInformation.aspx"
><i
class
=
"fa fa-question-circle-o"
></i>Book Purchase
Details</a></li>
<li><a href=
"UserInfo.aspx"
><i
class
=
"fa fa-list"
></i>Normal Student Info</a></li>
<li><a href=
"FranchiseStudentInfo.aspx"
><i
class
=
"fa fa-list"
></i>Franchise Student
Info</a></li>
<li><a href=
"FranchiseInfo.aspx"
><i
class
=
"fa fa-list"
></i>Franchise Info</a></li>
<li><a href=
"Promotions.aspx"
><i
class
=
"fa fa-list"
></i>Promotions</a></li>
</ul>
</div>
</div>
</asp:Panel>
<asp:Panel ID=
"pnlLicence"
runat=
"server"
Visible=
"false"
>
<ul
class
=
"list-unstyled"
>
<li><a href=
"ManageLicence.aspx"
><i
class
=
"fa fa-id-card"
></i>Manage Licence</a></li>
</ul>
<ul
class
=
"list-unstyled"
>
<li>
<asp:LinkButton ID=
"lnklogout"
runat=
"server"
OnClick=
"logout"
><i
class
=
"fa fa-sign-out"
></i> Logout</asp:LinkButton></li>
</ul>
</asp:Panel>
</div>
</div>
</div>
</div>
<div
class
=
"col-lg-10 norightpadding noleftpadding"
>
<div
class
=
"rightbox"
>
<div
class
=
"righttopbox"
>
</div>
<asp:ContentPlaceHolder ID=
"ContentPlaceHolder1"
runat=
"server"
>
</asp:ContentPlaceHolder>
</div>
</div>
</form>
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"
></script>
<script src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
></script>
</body>
</html>
In the above two image when i click on manage course links like manage course, manage topics then i want always open the Manage Course Menu. When i click on Manage Content menu like Manage FAQ, Manage Blog then Manage Content Menu will be opened and other are collapse. So how this is possible using javascript. Menu is collapse on window.onload fuction. So how i solve this problem
Reply
Answers (
1
)
How to find last achor click event fired on window onload fu
I am unable to run the following typescript program.