A small demo of js-graph-it, js-graph-itdemo

Source: Internet
Author: User

A small demo of js-graph-it, js-graph-itdemo
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Title> New Document </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Meta name = "Generator" content = "EditPlus">
<Meta name = "Author" content = "">
<Meta name = "Keywords" content = "">
<Meta name = "Description" content = "">


<Script type = "text/javascript" src = "js-graph-it.js"> </script>
<Link rel = "stylesheet" type = "text/css" href = "js-graph-it.css"/>
<Link rel = "stylesheet" type = "text/css" href = "sf-homepage.css"/>
<Script>
Function onLoad (){
ResizeCanvas ();
InitPageObjects ();
}
/**
* Resizes the main canvas to the maximum visible height.
*/
Function resizeCanvas ()
{
Var divElement = document. getElementById ("mainCanvas ");
Var screenHeight = window. innerHeight | document. body. offsetHeight;
DivElement. style. height = (screenHeight-16) + "px ";
}


</Script>
</Head>


<Body onload = "onLoad ()">
<Div id = "mainCanvas" class = "canvas" style = "width: 100%; height: 500px;">
<! -- H1 and h2 objects -->
<H1 id = "aaa" class = "block draggable" style = "left: 30px; top: 30px;"> aaaa <H2 id = "one" class = "block draggable" style = "left: 130px; top: 130px;"> one <! -- Connects the connection lines of two objects, expressed in css, up_start; down_start; right_start; left_start -->
<Div class = "connector aaa one down_start">

</Div>


<! -- There are two lines to get out of this object and connect different two objects -->
<Div id = "description2_block" class = "block draggable" style = "left: 350px; top: 300px;">
Totle
<Div id = "description2_out1" class = "block dock_point" style = "right:-2px; top: 20%;"> </div>
<Div id = "description2_out2" class = "block dock_point" style = "right:-2px; top: 80%;"> </div>
</Div>


<Div id = "no_js_code_block" class = "block draggable" style = "left: 580px; top: 200px;">
One
</Div>

<Div class = "connector description2_out1 no_js_code_block right_start">

</Div>

<Div id = "drag_and_drop_block" class = "block draggable" style = "left: 580px; top: 340px;">
Two
</Div>

<Div class = "connector description2_out2 drag_and_drop_block right_start">

</Div>


<! -- Connection between two objects -->
<Div id = "a" class = "block draggable" style = "left: 230px; top: 230px;">
Aaaaaa
<Div id = "a1" class = "block dock_point" style = "right:-2px; top: 20%;"> </div>
<Div id = "a2" class = "block dock_point" style = "right:-2px; top: 80%;"> </div>
</Div>


<Div id = "B" class = "block draggable" style = "left: 330px; top: 330px;">
Bbbbbb
<Div id = "b1" class = "block dock_point" style = "left:-2px; top: 20%;"> </div>
<Div id = "b2" class = "block dock_point" style = "left:-2px; top: 100%;"> </div>
</Div>

<Div class = "connector a1 b1 right_start">

</Div>


<Div class = "connector b2 a2 down_start">

</Div>

<P class = "block" style = "position: absolute; bottom: 2px; right: 2px;"> tested on Internet Explorer 6, Mozilla Firefox 1.0 and 1.5, opera 9.01 </p>
</Div>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.