You are here

function ajax_command_css in Drupal 7

Creates a Drupal Ajax 'css' command.

The 'css' command will instruct the client to use the jQuery css() method to apply the CSS arguments to elements matched by the given selector.

This command is implemented by Drupal.ajax.prototype.commands.css() defined in misc/ajax.js.

Parameters

$selector: A jQuery selector string. If the command is a response to a request from an #ajax form element then this value can be NULL.

$argument: An array of key/value pairs to set in the CSS for the selector.

Return value

An array suitable for use with the ajax_render() function.

See also

http://docs.jquery.com/CSS/css#properties

Related topics

1 call to ajax_command_css()
ajax_forms_test_advanced_commands_css_callback in modules/simpletest/tests/ajax_forms_test.module
Ajax callback for 'css'.

File

includes/ajax.inc, line 1150
Functions for use with Drupal's Ajax framework.

Code

function ajax_command_css($selector, $argument) {
  return array(
    'command' => 'css',
    'selector' => $selector,
    'argument' => $argument,
  );
}