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
The way to do this would be use the ajaxcomplete function in jQuery which is called implicitly after the completion of any ajax call.
The examples in this link should get you started
.ajaxcomplete() Function
You can use ajaxComplete():
$.ajaxComplete(function () {
// Something to execute after AJAX.
});
Have this as an example:
$( document ).ajaxComplete(function( event,request, settings ) {
$( "#msg" ).append( "<li>Request Complete.</li>" );
});
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.