Random Borders : Border : Ajax Layer JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Ajax Layer » Border »

 

Random Borders




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


var styles=['solid','dotted','inset','outset','groove'];
function generate(n) {
  for (var i=0;i<n;i++) {
    var d = new DynLayer();
    d.setBgColor(dynapi.functions.getRandomColor());
    d.setSize(10+80*Math.random(),10+80*Math.random());
    d.setLocation(100+500*Math.random(),400*Math.random());
    color = '#'+dynapi.functions.getRandomColor();
    d.setBorder(parseInt(4*Math.random()),color,styles[parseInt(4*Math.random())]);
    dynapi.document.addChild(d);
  }
}

generate(100)

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

           
       

Download : Download nav_dynapi.zip nav_dynapi.zip


-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Ajax Layer
» Border