Replies: 1 comment 4 replies
-
你指的容器是什么呢? 对 jsMind 而言,只会把 mindmap 绘制在 option 里指定的那个 container 元素里,jsMind 不会对容器进行任何的操作,包括样式以及行为。你可以对该元素进行修饰,包括大小、位置、边框等。 使用时建议给 container 设置合适的尺寸,以确保思维导图能够正确显示。如果在显示思维导图后再次调整 container 的尺寸,还需要在调整尺寸后调用 API resize 来调整思维导图的尺寸。 <div id="jsmind_container" style="width: 800px; height: 500px;"></div>
<script>
var options = {
container: 'jsmind_container',
editable: true,
theme: 'primary',
};
var mind = new jsMind(options);
// 动态调整尺寸
function resizeMindMap() {
var container = document.getElementById('jsmind_container');
container.style.width = '1000px';
container.style.height = '600px';
mind.resize();
}
</script> |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
如何实现初始化时,根据容器大小自适应刚好能完全看到整个mindmap
Beta Was this translation helpful? Give feedback.
All reactions