Skip to content

Commit

Permalink
Ensure jQuery for scrollTo
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Oct 31, 2019
1 parent db4f8d7 commit 5eb7fa5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ public function move($x, $y)
*/
public function scrollTo($selector)
{
$this->ensurejQueryIsAvailable();

$selector = $this->resolver->format($selector);

$this->driver->executeScript("$(\"html, body\").animate({scrollTop: $(\"$selector\").offset().top}, 0);");
$this->driver->executeScript("jQuery(\"html, body\").animate({scrollTop: jQuery(\"$selector\").offset().top}, 0);");

return $this;
}
Expand Down

0 comments on commit 5eb7fa5

Please sign in to comment.