Solved

jQuery div 1 fadeout div 2 fadein

Posted on 2011-03-16
1
512 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

828 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