Thursday, May 07, 2015

Some effect with datatables

.highlight{
    background-color: rgba(255, 200, 50, 0.1) !important;
}
tbody tr:hover {
    background-color: rgba(255, 200, 50, 0.1) !important; 
}







$(document).ready(function() {
    var lastIdx = null;
    var table = $('table').DataTable();
    $('table tbody')
            .on( 'mouseover', 'td', function () {
                var colIdx = table.cell(this).index().column;

                if ( colIdx !== lastIdx ) {
                    $( table.cells().nodes() ).removeClass( 'highlight' );
                    $( table.column( colIdx ).nodes() ).addClass( 'highlight' );
                }
            } )
            .on( 'mouseleave', function () {
                $( table.cells().nodes() ).removeClass( 'highlight' );
            } );
} );


No comments:

Post a Comment

How to revert comments Youtube layout?

#see video for details  https://www.youtube.com/watch?v=J0L_nYtNlqs #uBlock Origin  https://chrome.google.com/webstore/detail/ublock-o...