|
what you have done here is created a
<div>
and attempted the use the div's
.addEventListener()
member function. It does not have one.
:-)
the following will work
<html>
<head> <title>DynAPI Distribution: Inline Layers Example</title> <script language="JavaScript" src="./src/dynapi.js"></script> <!-- You must include the following scripts to
make it happen -->
<!-- browser detection object. This is used by
the other objects
to make the whole deal cross-borwser --> <script language="Javascript" src="./src/lib/dynapi/api/browser.js"></script> <!-- the basic layer object -->
<script language="Javascript" src="./src/lib/dynapi/api/dynlayer.js"></script> <!-- the DynAPI.document functions...
-->
<script language="Javascript" src="./src/lib/dynapi/api/dyndocument.js"></script> <!-- enabled events: such as the
EventListener() object and the DynLayer function
.addEventListener()-->
<script language="Javascript" src="./src/lib/dynapi/api/events.js"></script> <script
language="Javascript">
DynAPI. { layer1 = new DynLayer(); // create an instance of the DynLayer object (this is your Layer) //Add the layer to the document.. This must be done so that the object can be acces via DynAPI object arrays DynAPI.document.addChild(layer1); layer1.moveTo(100,100); // move the layer to position 100 pixels form the top and 100 pixels from the left layer1.setSize(100,100); // make the layer 100 pixels wide by 100 pixels heigh layer1.setBgColor('#33cc66'); // set the layer's background color layer1.setVisible(true); // make the layer visible var myevent1 = new EventListener(layer1); //Create an event listener for Layer1 myevent1. { //set the event listener to listen for mousup events alert('Click'); } layer1.addEventListener(myevent1); // attach the event listener to the layer } </script> </head> <body> <a href="javascript:layer1.setBgColor('red')">Change Color</a> </body> </html>
|
- [Dynapi-Help] question for new user Greg Jacobson
- Re: [Dynapi-Help] question for new user Richard Bennett
- RE: [Dynapi-Help] question for new user Doug Melvin
- RE: [Dynapi-Help] question for new user Jon McLennan
- RE: [Dynapi-Help] question for new user Darryl Cousins
- RE: [Dynapi-Help] question for new user Pascal Bestebroer
- RE: [Dynapi-Help] question for new user martin str�m
- RE: [Dynapi-Help] question for new user Greg Jacobson
- RE: [Dynapi-Help] question for new user Pascal
