JavaScript
  Home arrow JavaScript arrow Special Effects with DHTML Rollovers
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 
Sun Developer Network 
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

Special Effects with DHTML Rollovers
By: Ian Felton
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 16
    2004-09-28

    Table of Contents:
  • Special Effects with DHTML Rollovers
  • Enter the JavaScript
  • The Main Effect and Implementation
  • Putting it all Together

  • 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


    Special Effects with DHTML Rollovers


    (Page 1 of 4 )

    It’s common knowledge that JavaScript image rollover scripts became very popular in the early days of the Internet. While some people feel rollover effects have become perhaps, cliché, there are many ways to build upon simple rollover effects using JavaScript and style sheets. For the purpose of this tutorial, we’ll focus on several effects and the basics of how to set up images for creating rollover special effects with DHTML.

    To jumpstart some ideas about image special effects using DHTML, this article will illustrate an effect called ‘Shudder’. A poetry site of mine used the effect for a poem called ‘Shudder,’ hence the name of the function. Before getting into the tutorial, go here http://unitedbands.com/devArticles/shudder.html and see a general example of the shudder effect.

    Now that you know what the final outcome should look like, let’s dig into some code. As a lead-in page, two style sheet variables are defined in the head of the HTML page. These variables will eventually be assigned to DIV tags that hold the images that are used.

    <STYLE TYPE="text/css">
    <!--
      #Central {position:absolute; left:0;   top:0; width:575; height:300; z-index:2; visibility:hidden;}
      #Behind {position:absolute; left:0;   top:0; width:575; height:300; z-index:1; visibility:hidden;} 
    //-->
    </STYLE>// Sets variables for image manipulation

    The #central and #behind labels describe the state of the two images. These labels can be named arbitrarily. For this example, the key variable is the z-index. The z-index describes depth on a 3-dimensional grid. The lower the z-index, the deeper the object will appear on the page. #Behind should be under #Central so #Behind’s z-index is 1 and #Central’s is 2. Now two place-holders have been set in place for the ‘Shudder’ effect.

    More JavaScript Articles
    More By Ian Felton


       · Eh, why on earth would you use js for this when you have the :hover css-property? It...
       · Thanks for the post.Hover is useful, but the article was demonstrating how to...
       · Check out the cited example site (http://unitedbands.com/devArticles/shudder.html)...
       · .... doesn't work in Mozilla.
       · The shudder effect was tested on IE 6 and Opera 6.5 where it works fine. I'm sure...
       · Are not really helpful in a web environment that strives for standard compliance and...
       · If I hear one more silly rant about compatibility (which really means homogenizing...
       · Sure it's a neat effect but no rubbish about web standards being a homogenisation...
     

    JAVASCRIPT ARTICLES

    - Using Click Interceptions with a Database-Dr...
    - Using JavaScript Click Interceptions in an I...
    - Using Click Interceptions with JavaScript
    - QuickSort in Action
    - Quicksort
    - Using Mod_Security to Protect Your Server
    - Detecting and Countering Server Intrusions
    - Securing Your Web Server
    - Building a Secure Web Server
    - Protecting the Server
    - Book Review: Learning the Yahoo! User Interf...
    - Dynamically Generate a Selection List in a R...
    - Intergrate DWR into Your Java Web Application
    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT