Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Taking Your Talent to the Web: A Guide for the Transitioning Designer- P17:It was a simple solution to a complex problem. On one side, thousands of designers and art directors are eager to take their talents to the Web but aren’t sure how. On the other, web agencies could not find enough good web designers to get their work done. | Taking Your Talent to the Web 321 Recognize that developers bash their brains out writing code like this because browsers behave so inconsistently from version to version and platform to platform. Be glad you re going into web design and not web development. Be kind to your programmers. On the off-chance that you find this stuff enthralling or decide to switch from design to development you ll find an abundance of good browser detection information at http webreference.com tools browser javascript.html and http developer.netscape.com viewsource krock_v5.html. Unfortunately there is always the chance that by the time you read this book these pages will have moved or disappeared. If so check the Resources Department at http www.webstandards.org for the latest on browser detection. Going Global with JavaScript Just as with style sheets Chapter 10 it is possible and often desirable to save time hassles and bandwidth by creating one or more global JavaScript documents which can then be used to control whole sections of your site or even the entire site. For instance the My Glamorous Life section at zeldman.com http www.zeldman.com glamorous is controlled by a single JavaScript document http www.zeldman.com glamorous glam.js . The document in its entirety reads as follows Menubar preload. Pretty standard stuff. function newlmage arg if document.images rslt new lmage rslt.src arg return rslt function changeImages if document.images preloadFlag true for var i 0 i changelmages.arguments.length i 2 document changelmages.arguments i .src changelmages.arguments i 1 322 HOW The Joy of JavaScript Going Global with JavaScript var preloadFlag false function preloadImages if document.images tocover newImage . omen2 coreover.gif funover newImage . omen2 funover.gif alaover newImage . omen2 alaover.gif 15over newImage . omen2 15over.gif stealover newImage . omen2 stealover.gif webover newImage . omen2 webover.gif miscover newImage . omen2 miscover.gif comingover newImage . .