function ScrollTopCommand::__construct

Same name in other branches
  1. 9 core/modules/views/src/Ajax/ScrollTopCommand.php \Drupal\views\Ajax\ScrollTopCommand::__construct()
  2. 8.9.x core/modules/views/src/Ajax/ScrollTopCommand.php \Drupal\views\Ajax\ScrollTopCommand::__construct()
  3. 11.x core/lib/Drupal/Core/Ajax/ScrollTopCommand.php \Drupal\Core\Ajax\ScrollTopCommand::__construct()

Constructs a \Drupal\Core\Ajax\ScrollTopCommand object.

Parameters

string $selector: A CSS selector.

File

core/lib/Drupal/Core/Ajax/ScrollTopCommand.php, line 25

Class

ScrollTopCommand
Provides an AJAX command for scrolling to the top of an element.

Namespace

Drupal\Core\Ajax

Code

public function __construct($selector) {
    $this->selector = $selector;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.