Previewing Links with AjaxThere's a handy and great-looking visual effect that many sites are using now, where, when you hover the mouse pointer over a link, the first few lines of the page that is the link's destination appear in a floating window under the cursor (Figure 15.5). This turns out to be a fairly easy-to-create Ajax application. You'll find the HTML in Script 15.8, the CSS in Script 15.9, and the JavaScript in Script 15.10. Figure 15.5. When you hover over a link, this script reads the HTML file on the server and gives you an overlay containing a preview of the first few lines of the file.Script 15.8. This HTML builds the page for the preview example.
Script 15.9. This CSS styles the preview pop-up.
Script 15.10. The JavaScript that allows the server request and the appearance of the pop-up.To use Ajax to preview links: Tips
|