For example, the following code is setting the canvas attribute with
using lzSetCanvasAttribute method, that is contained in the embed.js file.
You can work it in case of using 'resizeTo()', but do not work it with
lzSetCanvas..().
My question is,
1. Can i set the canvas attributes after it has been initialized ?
2. If i can do it, is the example code correct ?
HTML:
<html>
<head>
<title></title>
<script type="text/javascript" language="javascript"
src="../lps/includes/embed.js"></script>
</head>
<body>
<script type="text/javascript">
lzEmbed({url: 'browser_resize2.lzx?lzt=swf', bgcolor:
'#0000ff', width: '100%', height: '100%'});
lzHistEmbed('/my-apps');
</script>
</body>
</html>
LZX:
<canvas debug="true" bgcolor="red">
<handler name="onwidth">
<![CDATA[
Debug.write( "width: " + this.width );
if( this.width < 800 ){
Debug.write( "resize" );
// LzBrowser.loadJS( "javascript:resizeTo(
'800', '600' )" );
LzBrowser.loadJS(
"javascript:lzSetCanvasAttribute( 'width', 800 )" );
}
]]>
</handler>
</canvas>
Thx
mt1
Adam Wolff wrote:
Sorry, I misread this. I didn't realize that you were trying to call
functions in OL's embed.js. The syntax below is for embedding a javascript
library into your laszlo app.
You can call browser javascript using LzBrowser.
http://www.openlaszlo.org/lps/docs/reference/lzbrowser.html#meth-loadJS
A
On Dec 11, Adam Wolff wrote:
I think you want
<script src="embed.js"/>
A
On Dec 11, mt1 wrote:
Anyone let me know, please.
mt1 wrote:
Hi forks,
Can i use a functions, that contained embed.js file, in <canvas> ?
I mean as following
<canvas>
<script>
LzBrowser.loadJS( "../lps/includes/embed.js" );
</script>
<view>
<handler .....>
lzSetCanvasAttribute( ..... );
</handler>
</view>
</canvas>
If this work, it is possible to change the canvas attribute values while
a application working.
But dose not work it. Is there any tips or the canvas attribute can not
change after the application
has initialized ?
Thanks in advance
mt1