Web Development with jQuery®

(Elliott) #1

Showing and Hiding Elements (^) ❘ 229


FIGURE 8-1


$(document).ready(
function()
{
var animating = false;

Next, you set up a click() event on the element with the id name exampleAnimationShow.


$('input#exampleAnimationShow').click(
function(event)
{
event.preventDefault();

if (!animating)
{
animating = true;

var easing = $('select#exampleAnimationEasing').val();
var duration = parseInt($('input#exampleAnimationDuration').val());

$('div#exampleDialog').show(
duration,
easing,
function()
{
animating = false;
}

http://www.it-ebooks.info

Free download pdf