hello. okay, i give up :) stuck up into code and cannot figure out
what's what and where's where.
any ideas ?
here is the listing:
<!-- start of listing -->
<html>
<head>
<title>dynapi 2 layers/images</title>
<script language="Javascript" src="j/dynapi.js"></script>
<script language="Javascript">
DynAPI.setLibraryPath('j/lib/')
DynAPI.include('dynapi.api.*')
DynAPI.include('dynapi.event.*')
DynAPI.include('dynapi.ext.inline.js')
DynAPI.include('dynapi.gui.loadpanel.js');
DynAPI.include('dynapi.gui.dynimage.js');
</script>
<script language="Javascript">
DynAPI.onLoad=function()
{
m1 = DynImage.getImage('i/m-bar.gif');
m1_ = DynImage.getImage('i/m-bar_.gif');
var layerone = this.document.getAll()['layerone']
layerone.setVisible(false)
var layertwo = this.document.getAll()['layertwo']
layertwo.setVisible(false)
layerthree=new LoadPanel();
layerthree.setHTML("no file");
layerthree.setSize(77,200)
layerthree.setBgColor('green');
layerthree.moveTo(311,18);
layerthree.setVisible(true)
main=this.document.all['maindiv']
DynAPI.document.addChild(layerthree);
DynAPI.document.addChild(main);
}
function setone()
{
DynAPI.document.all['layerone'].setVisible(true)
DynAPI.document.all['layertwo'].setVisible(false)
}
function settwo()
{
DynAPI.document.all['layerone'].setVisible(false)
DynAPI.document.all['layertwo'].setVisible(true)
}
function loadthree()
{
layerthree.setURL('external.html')
}
</script>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="layerone" style="position:absolute; left:7px; top:226px; width:129px;
height:181px; z-index:1; background: #006699; layer-background-color: #006699"><a
href="javascript:alert('clicked')"
onmouseover="layerone.doc.images['imaaj2'].src='i/m-bar_.gif'"
onmouseout="layerone.doc.images['imaaj2'].src='i/m-bar.gif'"><img src="i/m-bar.gif"
border=0 name=imaaj2></a></div>
<div id="layertwo" style="position:absolute; left:155px; top:227px; width:129px;
height:181px; z-index:2; background: #CC0099; layer-background-color: #CC0099"></div>
<div id="maindiv">
<table width="300" border="0" cellspacing="0" cellpadding="0" height="200"
name="table1">
<tr>
<td bgcolor="#FFFF99" align="center" valign="middle">
<a href="javascript:setone()">one</a><br>
<a href="javascript:settwo()">two</a><br>
<a href="javascript:loadthree()">three</a><br><br>
<a href="javascript:alert('clicked')"
onmouseover="main.doc.images['imaaj1'].src='i/m-bar_.gif'"
onmouseout="main.doc.images['imaaj1'].src='i/m-bar.gif'"><img src="i/m-bar.gif"
border=0 name=imaaj1></a></td>
</tr>
</table>
</div>
</body>
</html>
<!-- end of listing -->
the 'i/something' images are just normal/highlighted pair o'images.
the code layout is just as i want - two inline layers and the third
one which is external. images are INLINE (that's my aim, actually).
1) the code for loading/switching layers works perfectly - everything
is allright
2) the code for image swapping... help me out here, please.
a) the code for main is okay in MSIE (mine is 5), but it errors-out in
netscape 4.7
b) the code inside the layerone errors-out in both browsers. any ideas
?
non-inline images are NOT the option for me. event handlers are NOT
the options for me - i want to keep the code small and clean - on my
page i gonna have TONS of images, so you can imagine the resulting
filesize and, more importantly, its readability :)
any better ideas ? any corrections ?
peace,
x.
http://xmypoe.com
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help