From 86fa9330f89a5e4d4d3e2b2e76c1070ae0cddcf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Sun, 11 Apr 2021 02:25:45 +0100 Subject: [PATCH] Fix issues with a missing jQuery $ --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index f7e1d7b..0a32b9a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,10 +24,10 @@ class Typer { * blinking for after the text * finishes typing. */ - constructor(element: HTMLElement, blink: number, blink_timeout: number) { + constructor(element: JQuery, blink: number, blink_timeout: number) { // Retrieve the current content and wipe it. We also make the // element visible if it was hidden. - this.element = $(element); + this.element = element; this.text = this.element.html(); this.element.html(""); this.element.css("visibility", "visible"); @@ -114,6 +114,6 @@ class Typer { } jQuery(($) => { - const typer = new Typer($(".head-line .typed").get(0), 500, 3000); + const typer = new Typer($(".head-line .typed").first(), 500, 3000); typer.type(); });