jQuery UI esempi - Aggiungi classe (Add Class)
Quando lo stile di animazione cambia per ogni elemento del set di elementi abbinati all'interno aggiunge la classe specificata.
Per ulteriori informazioni sulla .addClass()
i dettagli dei metodi, consultare la documentazione API .addClass () .
.addClass () 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 - .addClass () 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 {width: 240px; padding: 1em; font-size: 1.2em; border: 1px solid # 000; sfondo: #eee; color: # 333;} .newClass {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 () { $ ( "#effect") .addClass ( "NewClass", 1000, richiamata); return false; }); funzione di callback () { setTimeout (function () { $ ( "#effect") .removeClass ( "NewClass"); }, 1500); } }); </ Script> </ Head> <Body> <Div class = "toggler"> <Div id = "effetto" class = "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>