views:

23

answers:

1

Hi All,

i am using asp.net 2.0 and c#.

I have two divs and , what I want is this that when I click on the link, div1 will collapse and div2 expand and the vice versa. I have to do this in JQuery.

Please help, it's urgent. Thanks in advance.

A: 

With a simple Google search the first one is and a good one.

http://www.adipalaz.com/experiments/jquery/expand.html

Aristos
I have checked this already, I have downloaded the files too. but it is not working.
Rahul
@Rahul I just add it to my pages and its working very nice. What is your problem - where is not working for you ?
Aristos
I have done this thing: <script type="text/javascript"> jQuery(document).ready(function() { jQuery(".content1").hide(); jQuery(".content2").hide(); //toggle the componenet with class msg_body jQuery(".heading").click(function() { jQuery(".content1").slideToggle(500); jQuery(".content2").slideToggle(500); }); }); </script>
Rahul
and this code in the body:<p class="heading">Header-1 </p> <div class="content1">Div1</div> <br /> <div class="content2">Div2</div>
Rahul
It is working fine, but I want that when content1 is displayed contentent2 should be hide. please help
Rahul