Layer Inline : Layer Creation « Ajax Layer « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Dojo toolkit
7. Event
8. Event onMethod
9. Ext JS
10. Form Control
11. GUI Components
12. HTML
13. Javascript Collections
14. Javascript Objects
15. Javascript Properties
16. jQuery
17. Language Basics
18. Mochkit
19. Mootools
20. Node Operation
21. Object Oriented
22. Page Components
23. Rico
24. Scriptaculous
25. Security
26. SmartClient
27. Style Layout
28. Table
29. Utilities
30. Window Browser
31. YUI Library
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript DHTML » Ajax Layer » Layer Creation 
Layer Inline


http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
<html>
<head>
<title>DynAPI Examples - DynLayer [Inline]</title>
<script language="JavaScript" src="./dynapisrc/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('./dynapisrc/');
dynapi.library.include('dynapi.library');
dynapi.library.include('dynapi.debug');
dynapi.library.include('dynapi.api');
dynapi.library.include('dynapi.api.ext.DynLayerInline');
</script>
<script language="Javascript">

var mylayer, mychild, mygrandchild ;

dynapi.onLoad(init);

function init() {
  mylayer = DynLayer.getInline("mylayer");
  mychild = DynLayer.getInline("mychild", mylayer);

  // new method
  mygrandchild = new DynLayer()// create layer
  mygrandchild.setID('mygrandchild',true)// set inline id
  mychild.addChild(mygrandchild)//make sure to add the child to it's parent!

  var el = {
    onmousedown : function(e) {
      dynapi.debug.print('mousedown on '+e.getSource().id)
      e.preventBubble();
    }
  }

  mylayer.addEventListener(el);
  mychild.addEventListener(el);
  mygrandchild.addEventListener(el);
};

function checkProperties(dlyr) {
  var str = 'id '+dlyr.id+'\n'+
  'parent id = '+dlyr.parent.id+'\n'+
  'x '+dlyr.x+'\n'+
  'y '+dlyr.y+'\n'+
  'w '+dlyr.w+'\n'+
  'h '+dlyr.h+'\n'+
  'clip = '+dlyr.clip+'\n'+
  'z '+dlyr.z+'\n'+
  'visible = '+dlyr.visible+'\n'+
  'bgColor = '+dlyr.bgColor+'\n'+
  'bgImage = '+dlyr.bgImage+'\n'+
  'html = '+dlyr.html+'\n';

  alert(str);
}

</script>
<style type="text/css">
<!--

#mylayer {position:absolute; left:250px; top:50px; width:200px; height:200px; clip:rect(0px 200px 200px 0px); background-color:red; layer-background-color:red;}
#mychild {position:absolute; left:50px; top:50px; background-color:yellow; z-index:5; layer-background-color:yellow; layer-background-image:url("../src/dynapi/images/blank.gif");}
#mygrandchild {position:absolute; left:50px; top:100px; background-color:lime; z-index:5; layer-background-color:lime; layer-background-image:url("../src/dynapi/images/blank.gif");}

-->
</style>
</head>
<body bgcolor="#999999">

<p>Check Properties of:<br>
<a href="javascript:checkProperties(mylayer)">mylayer</a><br>
<a href="javascript:checkProperties(mychild)">mychild</a><br>
<a href="javascript:checkProperties(mygrandchild)">mygrandchild</a>

<div id="mylayer">
mylayer is inline
  <div id="mychild">
  mychild is inline
    <div id="mygrandchild">
    mygrandchild is inline
    </div>
  </div>
</div>

</body>
</html>

           
       
dynapi.zip( 791 k)
Related examples in the same category
1. Layer Create/Remove/Delete
2. Generate and destroy layers
3. This is an inline layer that was created after page load
4. Relative Layers : Dynamic creation example
5. Relative Layers : Basic example
6. Relative Layers
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.