Well, if ajaxform has a success property as most plugin functions of that sort do, you could use that. Something like:
Code:
jQuery(document).ready(function($) {
$('#photoimg').live('change', function(){
$("#preview").html('');
$("#preview").html('<div class="image_center"><img src="loader.gif" alt="Uploading...."/></div>');
$("#imageform").ajaxForm({
target: '#preview',
success: function(){
var id = 'z' + new Date().getTime(), $pancontainer, $img, options;
$("#preview").find('img').wrap('<div id="' + id + '" style="width:400px; height:300px;"></div>');
$pancontainer = $('div#' + id);
$pancontainer.css({position:'relative', overflow:'hidden', cursor:'move'});
$img = $pancontainer.find('img:eq(0)'); //image to pan
options = {
$pancontainer: $pancontainer,
pos: 'center',
curzoom: 1,
canzoom: 'yes',
wrappersize:[400, 300]
};
$img.imgmover(options);
}
});
}).submit();
});
Untested. Assumes ajaxform has a success property, and that there are no typos or logical inconsistencies in the code I wrote.
Save what you already have and put up a demo with this code. If it works, great! If not, give me a link to it.
Bookmarks