Here is a live test. it keeps resizing in a infinite loop why is happening?
It is really urgent.
Thanks
http://www.orbitlab.gr/beta/test/
this is the code
Code
<krpano onstart="showtext(Try to resize the browser, infostyle);">
<!-- use only a grid preview pano to save download space ;-) -->
<preview type="grid(cube,50,50,400,0xCCCCCC,0x999999,0xFFFFFF);" details="16" />
<view hlookat="-15" vlookat="-10" fov="80" fovmin="50" fovmax="150" maxpixelzoom="off" />
<textstyle name="infostyle"
origin="center" edge="center" textalign="center" background="false" border="false"
fontsize="40" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
showtime="5" fadetime="1.0"
/>
<!-- Events where the actions needed to set the area and the border are called -->
<events onresize="set_area_size();"
onenterfullscreen="reset_area_size();"
onexitfullscreen="set_area_size();"
/>
<style name="buttonstyle" url="%SWFPATH%/plugins/textfield.swf" children="false"
visible="false" width="150" height="22"
css="p{color:#000000; font-family:Arial; font-weight:bold; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
backgroundcolor="0xFFFFFF" roundedge="5" shadow="1" borderwidth="0" glow="4" glowcolor="0xFFFFFF"
onover="tween(alpha,0.7,distance(0.3,0.2));"
onout="tween(alpha,1.0,distance(0.3,0.2));"
onloaded="set(alpha,0);set(textblur,15);set(blur,15); set(visible,true); tween(alpha,1,0.3); tween(textblur,0,0.3); tween(blur,0,0.3);"
/>
<plugin name="set_area" keep="true" style="buttonstyle"
html="[p]set_area[/p]"
align="bottom" x="-170" y="25"
onclick="set_area_size();"
/>
<plugin name="reset_area" keep="true" style="buttonstyle"
html="[p]reset_area[/p]"
align="bottom" x="0" y="25"
onclick="reset_area_size();"
/>
<plugin name="border" keep="true" style="buttonstyle"
html="[p]set border[/p]"
align="bottom" x="170" y="25"
onclickBorderFalse="set(area_vars.border.value,false); reset_border(); set(plugin[border].onclick,get(onclickBorderTrue)); set(plugin[border].html,'[p]border = false[/p]');"
onclickBorderTrue="set(area_vars.border.value,true); set_border(); set(plugin[border].onclick,get(onclickBorderFalse)); set(plugin[border].html,'[p]border = true[/p]');"
onclick="set(area_vars.border.value,false); reset_border(); set(plugin[border].onclick,get(onclickBorderTrue)); set(plugin[border].html,'[p]border = false[/p]');"
/>
<!-- area border -->
<plugin name="border_top" url="border_x2.png" enabled="false" align="top" width="100%" accuracy="1" />
<plugin name="border_bottom" url="border_x2.png" enabled="false" align="bottom" width="100%" accuracy="1" />
<plugin name="border_left" url="border_x2.png" enabled="false" align="left" height="100%" accuracy="1" />
<plugin name="border_right" url="border_x2.png" enabled="false" align="right" height="100%" accuracy="1" />
<!-- define variables to set the area -->
<area_vars>
<image_width value="500" />
<image_height value="200" />
<margin value="30" />
<border value="true" />
</area_vars>
<!-- actions to set the area -->
<action name="set_area_size">
set(events.onresize,'set_area_size();');
div(aspect,get(area_vars.image_width.value),get(area_vars.image_height.value));
set(dest_area_x,get(area_vars.margin.value));
mul(temp_val,dest_area_x,2); sub(dest_area_width,stagewidth,get(temp_val));
div(dest_area_height,dest_area_width,aspect);
sub(temp_val,stageheight,dest_area_height); div(dest_area_y,get(temp_val),2);
if(dest_area_y LT dest_area_x, set(dest_area_y,get(area_vars.margin.value));
mul(temp_val,dest_area_y,2); sub(dest_area_height,stageheight,get(temp_val));
mul(dest_area_width,dest_area_height,aspect);
sub(temp_val,stagewidth,dest_area_width); div(dest_area_x,get(temp_val),2); , );
set(area.x, 0);
set(area.y, 0);
set(area.width, get(stagewidth));
set(area.height, get(stageheight));
tween(area.x, get(dest_area_x));
tween(area.y, get(dest_area_y));
tween(area.width, get(dest_area_width));
tween(area.height, get(dest_area_height),,,WAIT);
if( area_vars.border.value == true, set_border(););
</action>
<action name="reset_area_size">
set(events.onresize,);
tween(area.x, 0);
tween(area.y, 0);
tween(area.width, get(stagewidth));
tween(area.height, get(stageheight),,,WAIT);
set(area.x, 0%);
set(area.y, 0%);
set(area.width, 100%);
set(area.height, 100%);
if( area_vars.border.value == false, reset_border(););
</action>
<!-- action to set the area border -->
<action name="set_border">
set(plugin[border_top].visible,true);
set(plugin[border_bottom].visible,true);
set(plugin[border_left].visible,true);
set(plugin[border_right].visible,true);
</action>
<!-- action to reset the area border -->
<action name="reset_border">
set(plugin[border_top].visible,false);
set(plugin[border_bottom].visible,false);
set(plugin[border_left].visible,false);
set(plugin[border_right].visible,false);
</action>
</krpano>
Display More