Reputation:
I have some divs as follows.
<body>
<div class="main">
<div class="page1 active">
<p>Page1</p>
<button id="btn-about">Page2</button>
</div>
<div class="page2">
<p>Page2</p>
</div>
</div>
</body>
The pages are hidden by default unless they have the active class. To display a new page, I remove all active classes within the div which has class main and then add the active class to the page I want, for e.g page 2.
With something like this
$("#btn-about").click(
function(e) {
e.preventDefault();
$(".main div").removeClass("active");
$(".main .page-2").addClass("active");
}
);
And then it becomes something like this:
<div class="page2 active">
<p>Page2</p>
</div>
It works fine but now I want, using CSS3, to hide or show the pages with certain effects. Sliding Up, Sliding Down, Sliding Left, Sliding Right or Fades.
I am a newbie regarding CSS3 and would appreciate all the help.
Upvotes: 0
Views: 463
Reputation: 173
For CSS animations you can use the transition:
style, for a sequence of transitions combine it with transition-delay:
Here are some good places to start researching:
And this tutorial has the transitions you mentioned:
Upvotes: 1
Reputation: 654
I think you can look at
Upvotes: 0