add support for automatically scrolling code highlights into view
This commit is contained in:
15
demo.html
15
demo.html
@ -102,7 +102,7 @@
|
||||
|
||||
<section data-auto-animate>
|
||||
<h2 data-id="code-title">With animations</h2>
|
||||
<pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4|4,8-11">
|
||||
<pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4,8-11|17|22-24">
|
||||
import React, { useState } from 'react';
|
||||
|
||||
function Example() {
|
||||
@ -117,6 +117,19 @@
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SecondExample() {
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p>You clicked {count} times</p>
|
||||
<button onClick={() => setCount(count + 1)}>
|
||||
Click me
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
</code></pre>
|
||||
</section>
|
||||
|
||||
|
Reference in New Issue
Block a user