GithubHelp home page GithubHelp logo

Comments (5)

ttsdzzg avatar ttsdzzg commented on July 1, 2024

看一下这个地址 http://hizzgdev.github.io/jsmind/
声明的也是<!DOCTYPE html>

from jsmind.

shaozujie avatar shaozujie commented on July 1, 2024

额... 这个是ok的,可是我这边不知道啥问题,只要是<!DOCTYPE HTML>就绘制不了,不要HTML或改为别的如HTML5则可以绘制...神奇... 我的用示例代码如下

<!DOCTYPE HTML>
<!-- <!DOCTYPE> -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Document</title>
    <link type="text/css" rel="stylesheet" href="jsmind-master/style/jsmind.css" />
        <script type="text/javascript" src="jsmind-master/js/jsmind.js"></script>
</head>

<body>
    <div id="container"></div>
    <script type="text/javascript">
        var mind = {
            "meta":{
                "name":"demo",
                "author":"",
                "version":"0.1"
            },
            "format":"node_tree",
            "data": {
                "id": "root",
                "topic": "web",
                "children": [{
                    "id": "easy",
                    "topic": "Easy"
                }, {
                    "id": "open",
                    "topic": "Open Source",
                    "children": [{
                        "id": "open1",
                        "topic": "on GitHub"
                    }, {
                        "id": "open2",
                        "topic": "BSD License"
                    }]
                }]
            }
        };

        var options = {
            container: 'container',
        };
        var jm = new jsMind(options);
        jm.show(mind);
    </script>
</body>
</html>

from jsmind.

hizzgdev avatar hizzgdev commented on July 1, 2024

看看控制台输出的内容。

from jsmind.

shaozujie avatar shaozujie commented on July 1, 2024

控制台和正常绘制输出的一样,这里实际上是已经绘制了,只不过标准h5文档声明<!DOCTYPE HTML>下,容器的高度未被撑开,即#container容器的高度为0,而子容器.jsmind-inneroverflowauto,此种情况下改为visible即可看到图了.
而示例代码http://hizzgdev.github.io/jsmind/中,通过函数`set_container_size()`给容器`#jsmind_container`设定了高度,从而避免了这个问题的出现。
现在要考虑的问题的是,如果不给容器设定高度,也不指定相关容器的overflow,能否像设置非标准h5文档声明一样可以自动撑开这个高度。
我抽时间再研究下源码,谢谢 @hizzgdev 的回复

from jsmind.

hizzgdev avatar hizzgdev commented on July 1, 2024

container容器的高度需要按业务场景自行指定。jsmind要确保自身不会超过预设的尺寸。不建议修改jsmind-inner的样式。

from jsmind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.