This is an inline layer that was created after page load : Layer Creation « Ajax Layer « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Event
7. Event onMethod
8. Form Control
9. GUI Components
10. HTML
11. Javascript Collections
12. Javascript Objects
13. Language Basics
14. Node Operation
15. Object Oriented
16. Page Components
17. Security
18. Style Layout
19. Table
20. Utilities
21. Window Browser
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
JavaScript DHTML » Ajax Layer » Layer Creation 
This is an inline layer that was created after page load


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

// Before the page loads you can use addHTML to add regular html text to the document.
// this will behave similar to the document.write() function in both ns4 and other browsers
dynapi.document.addHTML('Some Text <b>here Some Text</b> here Some Text here Some Text here Some Text here Some Text here');

dynapi.onLoad(function(){

  // After the page has been loaded the addHTML() function will behave differently in ns4 than in other browsers.
  // All HTML content added after the page has been loaded in ns4 will appear at location 0,0
  // while in other browsers it will be appended to the end of the document.
  // It's best to use the addHTML() to add inline layers to the document after a page load.

  // in ns4 you might have to use a <table> to force text-wrapping. The <layer> must always include a width and a height when using <table> with width="100%"
  var html='<table border="1" width="100%"><tr><td>This is an inline layer that was created after page load</td></tr></table>';

  if(dynapi.ua.ns4dynapi.document.addHTML('<layer id="myid2" width="100" height="100" bgcolor="yellow">'+html+'</layer>');
  else dynapi.document.addHTML('<div id="myid2" style="position:absolute;width:100px;height:100px;background-color:yellow;">'+html+'</div>');

  var lyr = new DynLayer();
  lyr.setID('myid2',true);
  dynapi.document.addChild(lyr);
  lyr.setLocation(100,100);
  lyr.setSize(150,100);
  lyr.setHTML(html);
});

</script>
</head>
<body bgcolor="#FFFFFF">
<script>
  dynapi.document.insertAllChildren();
</script>
</body>
</html>

           
       
dynapi.zip( 791 k)
Related examples in the same category
1. Layer Create/Remove/Delete
2. Generate and destroy layers
3. Relative Layers : Dynamic creation example
4. Relative Layers : Basic example
5. Layer Inline
6. Relative Layers
w___w_w.___jav___a_2___s_.___c___o_m___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.