O
Size: a a a
ИЛ
ИЛ
O
(function($) {
/**
* Replaces this element with the specified content using a fade-out and
* fade-in effect.
*
* @param {string} content
* The HTML to replace this element with.
* @param {integer} fadeOutTime
* The number of milliseconds for the fade out (defaults to 400 msec).
* @param {integer} fadeInTime
* The number of milliseconds for the fade in (defaults to 400 msec).
*/
$.fn.fadeReplaceWith = function(content, fadeOutTime, fadeInTime) {
if (fadeOutTime == null) {
fadeOutTime = 400;
}
if (fadeInTime == null) {
fadeInTime = 400;
}
(function(_this, content, fadeOutTime, fadeInTime) {
_this.each(function(index, element) {
Drupal.detachBehaviors($(element), Drupal.settings);
$(element).fadeOut(fadeOutTime, function() {
var replacementElement = $(content);
replacementElement.hide();
$(element).replaceWith(replacementElement);
replacementElement.fadeIn(fadeInTime);
Drupal.attachBehaviors(replacementElement.parent(), Drupal.settings);
});
});
})(this, content, fadeOutTime, fadeInTime);
};
})(jQuery);
ИЛ
O
function blocknify_submit_driven_callback($form, $form_state)
{
$nid = $form_state['values']['dropdown_first'];
$rendered_node = drupal_render(node_view(node_load($nid)));
$commands[] = ajax_command_invoke('#nodes_box', 'fadeReplaceWith', array($rendered_node, 500, 400));
return array(
'#type' => 'ajax',
'#commands' => $commands,
);
}
ИЛ
VS
ИЛ
АК