Code: Select all
$(function() {
$('select#type').change(function() {
$('#post-type-fields .dynamic').hide('slow', function() { $(this).find('div.text').remove() });
var postType = $(this).val();
$.getJSON('<?= $this->routeUrl('post_type_followup') ?>', {type: postType}, function(data) {
$('#post-type-fields .dynamic').hide().prepend(data.html).show('slow');
});
}).ajaxStart(function() {
$('#post-type-fields').css('background', 'transparent url("/img/icons/loading.gif") no-repeat 370px 3px');
}).ajaxStop(function() {
$('#post-type-fields').css('background', 'none');
});
});