diff --git a/src/Browser.php b/src/Browser.php index 04b9a1a13..e4287a840 100644 --- a/src/Browser.php +++ b/src/Browser.php @@ -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; }