toogleclass two div one above the other
Hi All!
I'm newbie to jquery..
I have tw
o
absolutely positioned div, one above the other.
One of two, have the class .hide {display:none}
Under the divs, there are two link that i would change the class from one div to the other, with a small fade.
The link 1 must assign the class to the div 2, the link 2 assign the class to the div 1.
So, the link 1 show the div 1, and the link 2 show the div 2.
I think it's easy.
I tried in this way, but don't work.
- $("ul>li>a.link1").click(function () {
- $('#div1').ToggleClass('hide')
.fadeToggle('slow', 'linear');
- $('#div2').ToggleClass('hide')
.fadeToggle('slow', 'linear');
- }
- $("ul>li>a.link2").click(function () {
- $('#div1').ToggleClass('hide').fadeToggle('slow', 'linear');
- $('#div2').ToggleClass('hide').fadeToggle('slow', 'linear');
- }
Where am I wrong?
Thanks to everyone who can help me!
Bye!