JavaScript
  Home arrow JavaScript arrow Building Dynamic Shadows with JavaScript a...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Building Dynamic Shadows with JavaScript and CSS
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating:  stars stars stars stars stars / 0
    2009-06-29

    Table of Contents:
  • Building Dynamic Shadows with JavaScript and CSS
  • Dropping shadows with CSS: building simple background images
  • Using CSS borders for shadowed web page elements
  • Building shadowed elements with liquid dimensions

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building Dynamic Shadows with JavaScript and CSS


    (Page 1 of 4 )

    Do you like the three-dimensional effects that dynamic shadows can add to your web site? In this three-part series, you'll learn how to create this effect with JavaScript and CSS. This first part shows you how to implement some basic CSS approaches to build a few primitive shadowed web page elements.

    Introduction

    Over the last few years, the steady trend to mess up JavaScript code with structural markup of web pages has thankfully changed. Consequently, more and more conscientious web developers use client-side scripting only in cases where it's necessary to extend (not replace) the behavior of a server-side web application.

    As you'll possibly know, this approach has proven to be efficient when developing web applications whose respective structural, presentational and behavioral modules reside on well-differentiated layers, which also make these applications more robust and easier to maintain.

    And certainly, the implementation of this multi-layered web development model is also applicable when JavaScript is used to create some visual effects that can be applied to certain elements of a web document.

    Definitely, there is a difference between attaching, for instance, some dynamic tool tips to a predefined number of DIVs included in a web page by mixing ugly inline event handlers with (X)HTML markup, merged in one monolithic file, and implementing the same effect by putting these two elements in different files. You spot the difference between these two approaches, right?

    However, one of the best advantages to using unobtrusive JavaScript code to extend the behavior of one or more elements of a web page is that a vast range of dynamic visual effects can be applied to them easily, without having to modify a single tag of the structural markup.

    To be frank, this concept can be applied with minor problems when it comes to adding dynamic shadows to determined elements included in a web document. Undoubtedly, the utilization of shadows can be quite useful for building realistic components that are used very often in the creation of web-based user interfaces. These components include buttons and drop-down menus, but the effect can be easily applied to other elements, like images or even entire web page backgrounds, in order to make them look more appealing.

    In summary, dynamic shadows can punch up the look and feel of certain sections of a web page. If you want to learn some straightforward techniques to include this popular visual effect in your own web sites, keep reading. In this series of articles I'll provide you with a bunch of code samples, aimed at demonstrating how to incorporate pretty realistic shadows into any element of a web document. I'll use both JavaScript and CSS, and more specifically, some methods provided by the DOM (Document Object Model).

    So, are you ready to learn how to build shadows via client-side scripting? Don't waste more time; start reading now!

    More JavaScript Articles
    More By Alejandro Gervasio


       · Adding shadows to web page elements is a pretty easy process that can be achieved...
     

    JAVASCRIPT ARTICLES

    - Validating Digits and Dates with jQuery`s Va...
    - Validating Ranges, Emails, and URLs with jQu...
    - More Uses for the jQuery Tooltip Plug-in`s b...
    - Building Image-Based Tooltips with the jQuer...
    - Using the jQuery Tooltip Plug-in`s bodyHandl...
    - Using Rangelength, Min and Max with the Vali...
    - Using Minlength and Maxlength with the Valid...
    - Modifying Tooltip Coordinates with the jQuer...
    - Applying a Fade Out Effect with the jQuery T...
    - Tracking Mouse Movements with the jQuery Too...
    - Checking Online Forms with the Validator jQu...
    - Nested JavaScript Functions as Objects
    - The jQuery Tooltip Plug-in
    - Active Client Pages at the Server
    - ACP Tab Web Page







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT