?
Solved

jQuery div 1 fadeout div 2 fadein

Posted on 2011-03-16
1
Medium Priority
?
515 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 27

Accepted Solution

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
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…
Suggested Courses

719 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