Hi, I'm trying to preload and animate images after a click on a button via AJAX w/ jQuery. The images are data objects associated with my page.
My Controller:
function getImages () {
if($this->isAjax) {
return $this->renderWith("AjaxImages");
}
else {
return Array();
}
}
My AjaxImages.ss view requests images via a regular <% control AjaxImages %> structure (which calls a controller method that is querying the image data from the DB).
The AJAX works fine… but I would like to preloaded the images first before showing them to the user. This is my code that handles the AJAX request:
$("#ajaxImages").click(function(e) {
e.preventDefault();
$("#ajaxContent").fadeOut(1500, function() {
$('#ajaxContent').load('/team/getImages', function() {
// how to get new dataobject values (image file names) in here??
});
});
$("#ajaxContent").delay(500).fadeIn(1500);
return false;
});
How can I access the dataobjects (requested from the view, retrieved by the controller) in the JS above?
Any help greatly appreciated...