Fade In and Out
so now lets have a go at fading in
and out content, this tutorial requires the jquery framework <button type="button"
onclick="change()">Click Me</button> add the CSS to make the box shape div#box next add in the following javascript var faded = false; when the button is pressed the javascript function is called and we use the faded variable to detected whether or not the div is faded. Then we either fade in or fade out the div and then set the faded flag for next time the button is pressed. Slide Content Lets have a look at how to slide in
some content, this tutorial requires the jquery framework. <div
id="box"></div> add the CSS div#box and add this javascript in function slide() the animate function has many different properties to it but for now we are going to just use the marginLeft to move the content to the right when the function is called. Slide Panel
The slide panel works by clicking on
the box and new content slides down. This tutorial requires the jquey framework
<div
id="title">Click me</div> and add the CSS div#title now for the javascript code $(document).ready(function(){ when the document is ready as in all code has been processed by the web browser we have a click event which drops the hidden content by using the slide toggle method. |