Coder Social home page Coder Social logo

jsncrdnl / shadow-animation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexpeattie/shadow-animation

0.0 2.0 0.0 100 KB

With this jQuery plugin, you can extend the animate function to support the CSS box shadow-property. You can animate the color, the x- and y-offset, the blur-radius and spread-radius.

Home Page: http://www.bitstorm.org/jquery/shadow-animation/

shadow-animation's Introduction

Shadow animation jQuery plugin

Easily animate box shadows

With this jQuery plugin, you can extend the animate function to support the CSS box shadow-property. You can animate the color, the x- and y-offset, the blur-radius and spread-radius. Mark Carver contributed code to support rgba-colors (the alpha channel). Alex Peattie contributed code to support other units (em and pt), and some misc. fixes.

Example

Change the shadow to a centered 30-pixel blur with the color blue (#44f):

$('#box1').animate({boxShadow: '0 0 30px #44f'});

Restrictions

The plugin works in the current versions for Firefox, Safari and Chrome. It also works in the platform preview release of Internet Explorer 9.

Due to a bug in Opera, it doesn't work in this browser. A bug report has been filed.

If setting the opacity of a shadow to 0, you should instead use a very small number like 0.01 (otherwise Firefox will lose the shadow's color information), like so:

.animate({boxShadow: 0 0 10px rgba(255,0,255,0.01)});

Currently, the shadow offset, blur and spread should be defined in pixels, ems or pts. Percentages and other units are unsupported. The plugin currently supports only one shadow.

Release history

Version 1.6, released March 11th, 2011. Added support for em and pt. Other minor fixes.

Version 1.5, released January 20th, 2011. Renamed shadow to boxShadow.

Version 1.4, released January 9th, 2011. Fixed support for elements without shadow set.

Version 1.3, released December 30th, 2010. Fixed support for alpha channel and negative offset.

Version 1.2, released October 3th, 2010. Fixed support for placing script in head.

Version 1.1, not released.

Version 1.0, released June 9th, 2010. First release.

License

This jQuery-plugin is available under the MIT and GPL License.

shadow-animation's People

Contributors

alexpeattie avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.