Change JS code to jQuery and add a slide effect when a table is shown/hidden