I need to change the position of an element i\'m loading with ajax. I want to use .css() to change it but jQuery can\'t find the element cause it\'
Make the css change in the complete or success function of the ajax call. Assuming you're using load:
$('#el').load(
url,
data,
function(){
$('#selector').css('position', 'absolute');
}
);
Alternatively (and easier to give as an example) register an ajaxComplete event
$(document).ajaxComplete(function(){
if($('#elementID').length != 0) {
$('#elementID').css('position', 'absolute');
}
});
This is fired each time an ajax request completes, checks to see if #elementID exists and if so applies the css.