[“
The jQuery UI effects framework is modularized, just like the widget framework, allowing you to choose which parts of the package you want to use and reduce the code requirements. You can create a custom download for yourself,<\/a> which takes into account dependencies between the modules.<\/p>\r\n
Color animation<\/h1>\r\n
\r\nHexadecimal digits\u2014#DDFFE8<\/li>\r\nMinimal hexadecimal digits\u2014#CFC<\/li>\r\nDecimal RGB values\u2014rgb(221, 255, 232)<\/li>\r\nDecimal RGB percentages\u2014rgb(87%, 100%, 91%)<\/li>\r\nDecimal RGB and transparency values\u2014rgba(221, 255, 232, 127)<\/li>\r\nA named color\u2014lime<\/li>\r\n<\/ul>\r\n$('#myDiv').animate({backgroundColor: '#DDFFE8'});<\/pre>\r\n
Class animation<\/h1>\r\n
$('#myDiv').addClass('highlight', 1000);<\/pre>\r\n
$('#myDiv').switchClass('oldClass', 'newClass', 1000);
<\/pre>\r\n
Common effects functions<\/h1>\r\n
$.effects.effect.slide = function( o, done ) {
\/\/ Create element
var el = $( this ),
\u00a0 \u00a0 \u00a0 \u00a0 props = [ \"position\", \"top\", \"bottom\", \"left\", \"right\", \"width\", \"height\" ],
\u00a0 \u00a0 \u00a0 \u00a0 mode = $.effects.setMode( el, o.mode","","\"show\" ), ...; \/\/ Determine mode of operation
\/\/ Adjust
$.effects.save( el, props ); \/\/\u00a0Save current settings
el.show();
distance = o.distance","","el[ ref === \"top\" ? \"outerHeight\" : \"outerWidth\" ]( true );
$.effects.createWrapper( el ).css({overflow: \"hidden\"}); \/\/\u00a0Create wrapper for animation
...
\/\/ Animation
animation[ ref ] = ...;
\/\/ Animate
el.animate( animation, {
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0queue: false,
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0duration: o.duration,
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0easing: o.easing,
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0complete: function() {
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0if ( mode === \"hide\" ) {
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0el.hide();
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0$.effects.restore( el, props ); \/\/\u00a0Restore original settings
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0$.effects.removeWrapper( el ); \/\/\u00a0Remove animation wrapper
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0done();
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 });
};<\/pre>\r\n
var baseline = $.effects.getBaseline(['middle', 20], {height: 100, width: 200}); \/\/ baseline = {x: 0.1, y: 0.5}<\/pre>\r\n
el.from = $.effects.setTransition(el, ['borderTopWidth', 'borderBottomWidth', ...], 0.5, el.from);<\/pre>\r\n
var value = el.cssUnit('width'); \/\/ e.g. value = [200, 'px']<\/pre>\r\n
Existing effects<\/h1>\r\n
\r\nblind:<\/strong>\u00a0Element expands or contracts vertically (default) or horizontally from its top or left<\/li>\r\nbounce:<\/strong>\u00a0Element drops into or out of view and bounces a few times<\/li>\r\nclip:<\/strong>\u00a0Element expands or contracts vertically (default) or horizontally from its center line<\/li>\r\ndrop:<\/strong>\u00a0Element slides into or out of view from the left (default) or top, and fades to or from full opacity<\/li>\r\nexplode:<\/strong>\u00a0Element breaks up into sections and flies apart, or reassembles itself from flying parts<\/li>\r\nfade:<\/strong>\u00a0Element fades to or from full opacity<\/li>\r\nfold:<\/strong>\u00a0Element expands or contracts first in one direction then in the other (horizontally then vertically by default)<\/li>\r\nhighlight:<\/strong>\u00a0Element changes background color briefly<\/li>\r\npuff:<\/strong>\u00a0Element decreases or increases in size, and fades to or from full opacity<\/li>\r\npulsate:<\/strong>\u00a0Element fades out and in several times<\/li>\r\nscale:<\/strong>\u00a0Element expands or contracts from or to its center point by a percentage amount<\/li>\r\nshake:<\/strong>\u00a0Element moves from side to side several times<\/li>\r\nsize:<\/strong>\u00a0Element decreases or increases in size to given dimensions<\/li>\r\nslide:<\/strong>\u00a0Element slides horizontally (default) or vertically from its own edge<\/li>\r\ntransfer:<\/strong>\u00a0Element is moved and resized to match a target element<\/li>\r\n<\/ul>\r\n$('#aDiv').hide('clip');
$('#aDiv').toggle('slide', {direction: 'down'}, 1000);<\/pre>\r\n
Summary<\/h1>\r\n
WDD Staff
WDD staff are proud to be able to bring you this daily blog about web design and development. If there’s something you think we should be talking about let us know @DesignerDepot.
Read Next
3 Essential Design Trends, June 2023
This month we are focusing on three trends within a bigger website design trend – different navigation menu styles and …
15 Best New Fonts, May 2023
The choices you make when selecting a typeface have more impact on your design than almost any other decision, so it’s …
By Ben Moss
10+ Best Tools & Resources for Web Designers and Agencies (2023 updated)
Having the ability to envision a tastefully designed website (i.e., the role creativity plays) is important. But being …
By WDD Staff
20 Best New Websites, May 2023
This month, there are tons of great new agency websites to get excited about. 3D animated prisms are a popular theme, a…
How to Find the Right White Label Website Builder for Your Agency
Web design agencies face a lot of obstacles in closing the deal with new clients. One of the most common ones is the ar…
By WDD Staff
Exciting New Tools For Designers, May 2023
There are hundreds of new tools for designers and developers released each month. We sift through them all to bring you…
3 Essential Design Trends, May 2023
All three of the website design trends here mimic something bigger going on in the tech space, from a desire to have mo…
10 Best AI Tools for Web Designers (2023)
It’s time to stop worrying if AI is going to take your job and instead start using AI to expand the services you can of…
By Simon Sterne
10 Best Marketing Agency Websites (Examples, Inspo, and Templates!)
Marketers are skilled in developing strategies, producing visual assets, writing text with high impact, and optimizing …
By WDD Staff
15 Best New Fonts, April 2023
Fonts are a designer’s best friend. They add personality to our designs and enable fine typography to elevate the quali…
By Ben Moss
20 Best New Websites, April 2023
In April’s edition, there’s a whole heap of large-scale, and even full-screen, video. Drone footage is back with a veng…
Exciting New Tools For Designers, April 2023
The AI revolution is having a huge impact on the types of products that are hitting the market, with almost every app b…