jQuery - hiding and showing content.

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
darek
Forum Newbie
Posts: 8
Joined: Tue Apr 19, 2011 2:26 am
Location: Opole, Poland

Re: jQuery - hiding and showing content.

Post by darek »

You will need too use css. See example below:

Code: Select all

<div style="position: relative;"> <-- you need to put "relative" here, otherwise "absolute" positioning will not work as you expect -->
  <div style="position: absolute; top: 0; left: 0;">this is first div</div>
  <div style="position: absolute; top: 0; left: 0;">this is second div</div>
</div>
The idea is to use "absolute" positioning. This way, both divs are in exactly the same place, one in top of another. Now, you use jQuery fadeIn and fadeOut, exactly as you did, nothing to change here.
Post Reply