ponysmith.github.io

tabletrimCallback Methods

Callback functions

The table below makes use of the ontrim() and onuntrim() callback functions to change the background of the table. Resize the screen to see the callbacks in action.
Username First Name Last Name Email
superman Clark Kent man.of.steel@gmail.com
batman Bruce Wayne dark.knight@gmail.com
wonderwoman Diana Prince my.invisible.jet@gmail.com
professorx Charles Xavier professor.x@gmail.com
hulk Bruce Banner green.machine@gmail.com
wolverine Logan ? weapon.x@gmail.com

Code for this example

1
2
3
4
5
6
7
8
9
var opts = { 
    ontrim: function(table) {
        table.css({ 'background-color': '#fffccc' })
    },
    onuntrim: function(table) {
        table.css({ 'background-color': 'initial' })
    }
}
tabletrim($('#tabletrim-example'), opts);