Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

jQuery div 1 fadeout div 2 fadein

Posted on 2011-03-16
1
Medium Priority
?
517 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 2000 total points
ID: 35146517
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

971 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