• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

javascript for expand and colapse

iam using C# code,i want javascript for expand/colapse , when we click on an item that will be expanded and other all expanded item should be colapsed, only the clicked item should be expanded.please help me how can i do this??
0
ninusajil
Asked:
ninusajil
1 Solution
 
designersxCommented:
here in this ajax will be used, you can get its complete tutorial on microsoft website

just type ajax videos in google and u will find the first link darkened. please go there.
0
 
ninusajilAuthor Commented:
sorry, i not like to use ajax for this, will u pls help using javascript for this
0
 
tetorvikCommented:
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
designersxCommented:
u can find the script of collapse and expand on

http://www.dynamicdrive.com/

just search here in this site, i am sure u will get it.
0
 
Sreedhar VengalaCommented:
You should be able to expand on this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
<title>Expand / Colapse Div</title>
 
<script type="text/javascript">
<!--
function toggle2(id, link) {
  var e = document.getElementById(id);
 
  if (e.style.display == '') {
    e.style.display = 'none';
    link.innerHTML = 'Expand';
  } else {
    e.style.display = '';
    link.innerHTML = 'Collapse';
  }
}
 
//-->
</script>
</head>
 
<body bgcolor="Background">
<a href="#" onclick="toggle2('content', this)">Collapse</a>
<div id="content" style="display:none">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc fermentum.
</div>
 
</body>
</html>

Open in new window

0
 
gaston_acevedoCommented:
expand a collapse what?
0
 
ninusajilAuthor Commented:
sorry for the late respose, i am  not well for some days.....

i tried this http://www.dynamicdrive.com/

this is working but when i expand any one and goes to some other page and returns back the expanded item expand as it is not colapsing
i want collapse all when i took that page
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now