22.04.2013 Views

HTML, XHTML & CSS

HTML, XHTML & CSS

HTML, XHTML & CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

76<br />

Part IV: Scripting and (X)<strong>HTML</strong><br />

Figure 16-10: <strong>HTML</strong> source code for our lightbox example.<br />

5. Create a link to launch the lightbox.<br />

In this example (see Figure 16-11), we use a small image to launch a<br />

larger one.<br />

<br />

<br />

Figure 16-11 shows how the lightbox looks on the Web page when<br />

completed. You can also view it online at www.dummieshtml.com/<br />

examples/ch16/lightbox.<br />

Here’s the magic part: We add some JavaScript to enable the lightbox to<br />

work with jQuery.<br />

6. Enter the following code into the head section of your document:<br />

<br />

$(document).ready(function() {<br />

$(“a#example”).fancybox({<br />

‘titleShow’: true<br />

});<br />

});<br />

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

Saved successfully!

Ooh no, something went wrong!