I need to add a class on after an ajax load. I first give a few elements a class \"ready\" which initiate a css transition. When the link li#menu-item-318 a gets clicked it
You can use ajaxComplete():
$.ajaxComplete(function () {
// Something to execute after AJAX.
});
Have this as an example:
$( document ).ajaxComplete(function( event,request, settings ) {
$( "#msg" ).append( "- Request Complete.
" );
});
As said by Popnoodles, this executes when any AJAX call completes. So if you are looking for executing the code in one particular AJAX call, you need to use the success
function.