jQuery UI esempi - Classe di conversione (Switch Classe)
Quando i cambiamenti di stile di animazione all'interno del set di elementi corrispondenti di aggiungere e rimuovere ogni elemento della classe specificata.
Per ulteriori informazioni sulla .switchClass()
i dettagli dei metodi, consultare la documentazione API .switchClass () .
.switchClass () Demo
Fare clic sul pulsante per visualizzare in anteprima gli effetti.
<! Html Doctype> <Html lang = "it"> <Head> <META charset = "utf-8"> <Title> jQuery UI Effetti - .switchClass () Demo </ title> <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <Src = "script // code.jquery.com/jquery-1.9.1.js"> </ script> <Src = "script // 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 {position: relative;} .newClass {width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; margin: 0;} .anotherNewClass {text-trattino: 40px; letter-spacing: .4em; Larghezza: 410 px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em;} </ Style> <Script> $ (Function () { $ ( "#button") .Click (Function () { $ ( ".newClass") .switchClass ( "NewClass", "anotherNewClass", 1000); $ ( ".anotherNewClass") .switchClass ( "AnotherNewClass", "NewClass", 1000); return false; }); }); </ Script> </ Head> <Body> <Div class = "toggler"> <Div id = "effetto" class = "NewClass ui-angolo-all"> Etiam libero neque, luctus una, eleifend nca, sempre a, lorem. Sed pede. </ Div> </ Div> <a href="#" id="button" class="ui-state-default ui-corner-all"> effetti correre </a> </ Corpo> </ Html>