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.

254<br />

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

});<br />

modal.append(data);<br />

},<br />

error: function(msg) {<br />

modal.append(msg);<br />

}<br />

});<br />

After saving the preceding code, load http://localhost/ <strong>and</strong> click an event title to see the new Close<br />

button (see Figure 7-3). Click the Close button to remove the modal window.<br />

Figure 7-3. The Close button is now visible in the modal window<br />

Add Effects to the Creation <strong>and</strong> Destruction of the Modal Window<br />

To give the modal window a little more style <strong>and</strong> polish, you’ll add effects to make the box fade in when<br />

it’s created <strong>and</strong> fade out when it’s removed. Also, to help draw focus to the modal window when it’s<br />

active, you’ll add an overlay to the site that will darken everything but the modal window.

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

Saved successfully!

Ooh no, something went wrong!