jQuery UI Beispiele - Farbanimation (Farb Animation)
Verwenden Sie .animate () Farbanimation zu erreichen.
Weitere Informationen über die Farbanimation (Farb Animation) Details finden Sie in der API - Dokumentation Farbanimation (Farbe Animation) .
jQuery UI gebündelt jQuery Farbe Plugin jQuery Farbe Plugin Farbanimation und viele andere farbbezogenen Utility-Funktionen zur Verfügung stellt.
Anime (Animation) Demo
Klicken Sie auf die Schaltfläche Effekte, um eine Vorschau.
<! DOCTYPE html> <Html lang = "de"> <Head> <Meta charset = "UTF-8"> <Titel> jQuery UI-Effekte - Animation (Animation) Demo </ title> <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <Script src = "// code.jquery.com/jquery-1.9.1.js"> </ script> <Script src = "// code.jquery.com/ui/1.10.4/jquery-ui.js"> </ script> <Link rel = "stylesheet" href = "http://jqueryui.com/resources/demos/style.css"> <Style> .toggler {width: 500px; height: 200px; position: relative;} #Button {padding: .5em 1em; text-decoration: none;} #effect {width: 240px; height: 135px; padding: 0.4em; position: relative; Hintergrund: #fff;} #effect h3 {margin: 0; padding: 0.4em; text-align: center;} </ Style> <Script> $ (Function () { var state = true; $ ( "#Button") .click (Function () { if (state) { $ ( "#effect") .animate ({ Backgroundcolor: "# aa0000", Farbe: "#fff", Breite: 500 }, 1000); } Else { $ ( "#effect") .animate ({ Backgroundcolor: "#fff", Farbe: "# 000", Breite: 240 }, 1000); } state = Zustand !; }); }); </ Script> </ Head> <Body> <Div class = "toggler"> <Div id = "Effekt" class = "ui-Widget-Inhalt ui-Ecke-all"> <H3 class = "ui-Widget-Header ui-Ecke-all"> Anime (Animation) </ h3> <P> Etiam libero neque, luctus ein, eleifend nec, semper an, Lorem. Sed pede. Nulla Lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi. </ P> </ Div> </ Div> <a href="#" id="button" class="ui-state-default ui-corner-all"> Schalteffekte </a> </ Body> </ Html>