资 源 简 介
CSS Class-based animations with jQuery
You might like this plugin if you can"t stand CSS/presentation creeping into your JavaScript through jQuery.fn.animate() calls.
Keep presentation where it should be (in linked or inline CSS class definitions) and just animate to and from CSS classes. Provides a lot of flexibility.
See examples.
Now you can write:
$("div").animate(".myCssSelectedClass");
instead of:
$("div").animate({ height: "100px", //expand down opacity: 1 //fade in// ... //etc, etc.}) .find("a") //now animate the anchor elems inside .animate({ top: 100px, left: 100px // slide in from upper left// ... // etc, etc. }) .end() .find("p") //and the paragraph elems .animate({ top