Solved

jQuery div 1 fadeout div 2 fadein

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
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…

707 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

16 Experts available now in Live!

Get 1:1 Help Now