The following examples are actually implemented in this very page.
Here is the html content I’ll be playing with :
STR : 15
STA : 9
WIS : 10
INT : 12
AGI : 17
STR : 19
STA : 17
WIS : 8
INT : 9
AGI : 12
STR : 8
STA : 7
WIS : 18
INT : 21
AGI : 11
Use the data attribute
HTML5 has a data attribute one can set on an element.
Here is an example as how to use it :
I want a filter on classes. I’ll have 3 buttons, each has an id equal to the button’s name displayed here.
Playing with css
To play with the page css, we can use the following methods :
- addClass( ‘classname’ ) – wich must therefore be defined in the loaded css
- removeClass ( ‘classname’) – wich must be defined in the loaded css / and used.
- toggleClass ( ‘classname’) – adds / removes a class.
Examples of that is used to highlight the buttons above.
jquery offers many way to play with animations.
Just mentioning it here.
For example, you could modify the top for -10px.
Speed is in ms. Default is 400ms.