02.06.2013 Views

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

256<br />

CHAPTER 7 ■ ENHANCING THE USER INTERFACE WITH JQUERY<br />

};<br />

}<br />

.fadeOut("slow", function() {<br />

$(this).remove();<br />

}<br />

);<br />

To incorporate this new function into the script, modify the click event h<strong>and</strong>ler for the Close button<br />

using the following bold code:<br />

// Creates a button to close the window<br />

$("")<br />

.attr("href", "#")<br />

.addClass("modal-close-btn")<br />

.html("&times;")<br />

.click(function(event){<br />

// Removes modal window<br />

fx.boxout(event);<br />

})<br />

.appendTo(modal);<br />

Save init.js <strong>and</strong> reload http://localhost/ in your browser. Click an event title to create a new<br />

modal window, then click the Close button to watch the modal window fade out (see Figure 7-4).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!