--- title: Javascript tree with autoscroll layout: page js: examples/autoscroll.js css: example.css ---

Example 7 - autoscroll

This is an example of autoscroll. The tree will scroll automatically if you drag an item outside of the tree.
Autoscroll will work automatically. There is no option for it.

html

{% highlight html %}
{% endhighlight %}

css

{% highlight css %} #scroll-container { height: 200px; overflow-y: scroll; user-select: none; } {% endhighlight %}

js

{% highlight js %} $('#tree1').tree({ data: ExampleData.example_data }); {% endhighlight %}