JavaScript
  Home arrow JavaScript arrow Toggling CSS Properties with the GX JavaSc...
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

Toggling CSS Properties with the GX JavaScript Animation Framework
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2010-02-09

    Table of Contents:
  • Toggling CSS Properties with the GX JavaScript Animation Framework
  • Toggling the width of a div in a single step
  • Dynamically expanding and contracting an HTML element
  • Toggling the opacity of an HTML element

  • 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


    Toggling CSS Properties with the GX JavaScript Animation Framework


    (Page 1 of 4 )

    In this ninth episode of the series, I provide you with some comprehensive examples that show how to toggle different properties of a sample div by using the core “gx()” method of the GX library. As with many tasks the GX JavaScript animation framework can be made to perform, toggling animations is a very simple process.

    If you develop websites frequently, then you’ll surely have noticed that client-side frameworks are very popular these days. Whether you need to create clean div-based web page layouts, or simply want to polish the visual presentation of your carefully-crafted (X)HTML documents, there is probably a framework out there that will do the hard work for you without a single complaint.

    Logically, this trend can also be seen in the JavaScript-based animation field. There is now a plethora of frameworks that permits developers to implement eye-catching visual effects on web pages in a simple fashion, and in a truly unobtrusive way.

    Among the numerous JavaScript-driven animation frameworks available nowadays for free use, there’s one that might be especially appealing to you. It boasts a powerful set of features and a flat learning curve. Yes, as you may have guessed, I’m talking about GX, a library that will let you animate any HTML element in a snap. What’s more, if you’re a strong advocate of jQuery, then you’ll find that using GX is a breeze, as the library relies on many of the native methods bundled with jQuery for performing its “magic.”

    To illustrate how useful GX can be for making web pages more dynamic, in previous articles of this series I covered the capabilities of the library for animating different properties of a simple div, either individually or simultaneously. Aside from showing how to perform these basic animations, I also discussed how to cancel, pause and resume a specific effect, thus demonstrating that the library provides users with a decent level of control over the way that animations are performed.

    It’s fair to say, though, that GX has many more features that deserve a closer analysis. This includes its ability to toggle values assigned to properties of HTML elements. As this can be very convenient for simplifying the execution of more complex animations, in the next few lines I’ll be coding some easy-to-follow examples that will help you grasp the logic behind creating toggling animations.

    Ready to learn the full details? Then let’s get started!

    More JavaScript Articles
    More By Alejandro Gervasio


       · Toggling properties of an HTML element is a simple process when using the GX...
     

    JAVASCRIPT ARTICLES

    - Dynamic Drop-down Menus: Javascript Progress...
    - Creating Drop-down Menus Using Progressive E...
    - Building Slide Shows Using Progressive Enhan...
    - Form Validation with Progressive Enhancement...
    - Validating Web Forms: an Introduction to Pro...
    - Ajax Progressive Enhancement: Reading Remote...
    - Ajax Image Requests: Progresive Enhancement ...
    - jQuery Image Gallery: Working with Progressi...
    - Progressive Enhancement in an Image Gallery
    - Building a Drop-Down Menu with the HoverInte...
    - Using All of the HoverIntent jQuery Plug-in`...
    - Controlling Mouseout Events with HoverIntent...
    - Using the Interval Argument of the HoverInte...
    - Tweaking the Sensitivity of the HoverIntent ...
    - Introducing the HoverIntent jQuery Plug-in







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek