Solved

jQuery div 1 fadeout div 2 fadein

Posted on 2011-03-16
1
510 Views
Last Modified: 2012-05-11
Hi

I have this HTML source here:
<div id="container" style="float:left;">
        <div id="div1" style="float:left; background-color:red; width:100px; height:20px;">Text1</div>
        <div id="div2" style="float:left; background-color:blue; width:100px; height:20px; display:none;">Text2</div>
    </div>

My problem is that I want "div2" to be hidden in the beginning and div1 visible. Then when I click "div1" and want it to fadeout and then I want "div2" to fadein. So now "div2" is visible and "div1" is hidden. So now I want to be able to click "div2" so it will fadeout and "div1" fadein.

Can anybody help me with this?
0
Comment
Question by:Fern2
1 Comment
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 500 total points
ID: 35146517
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now