Jimmy
Posts: 0
Joined: Sat Jun 01, 2013 4:23 am

Javascript Panel Height & Width

I tried the javascript code below and pw = 0 when in appery's property screen it' set to 250. What is wrong? Thanks.

var panel = Appery("panel_2");

var ph = panel.height();

var pw = panel.width();

alert(pw);

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Javascript Panel Height & Width

Hello,

You code should work. How did you invoke this code? Please ensure that Panel element name is "panel_2".

Jimmy
Posts: 0
Joined: Sat Jun 01, 2013 4:23 am

Javascript Panel Height & Width

panel element name is panel_2, it doesn't work. You can see for yourself. I have included the screenshots. Thanks.

Image Image

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Javascript Panel Height & Width

You should try to add this code on some button click action. It's not working because alert action triggering before creating panel element.

Jimmy
Posts: 0
Joined: Sat Jun 01, 2013 4:23 am

Javascript Panel Height & Width

Thanks, your suggestion worked. How do i get the default page resolution 320x480 instead of the panel_2 dimensions?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Javascript Panel Height & Width

Project - App Settings - Default Page Size

Jimmy
Posts: 0
Joined: Sat Jun 01, 2013 4:23 am

Javascript Panel Height & Width

I know that you can manually go to the settings to get the page size. I meant how do i get the page size through javascript? Thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Javascript Panel Height & Width

Hello! Try code$(window).width()/code and code$(window).height()/code

Return to “Issues”