Percentage graphic size depending on the browser window size

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
TWiegand
Posts: 20
Joined: Thu Aug 22, 2013 3:08 pm

Hello,
I would like to scale my graphics in percent depending on the browser window. So the specification would be,
GraphicABC, Size 50% (of the browser window). Currently, the percentage refers to the original size of the graphic.
Or can I query the size of the browser window dynamically and put it into a variable? Then I could calculate the scaling from that.
It's about the adaptation to mobile devices.
I know that I can create logic blocks and then use the size of the browser window as a condition in steps. But this is not the same as I imagine.

Thanks
User avatar
Hopki
Gnome
Posts: 13029
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

HI,
How are you displaying the images?
If you use the external image loader it will automatically scale with the display size.
This is easy and recommend you do it this way.

However, if you are just adding an image to the skin and want it to scale then you need to get clever with the CSS size setting, see the attached project.
It is keeping the video and image containers at a 16/9 aspect ratio, look at the Size setting.
Regards,
Attachments
project.zip
(32.89 KiB) Downloaded 157 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
TWiegand
Posts: 20
Joined: Thu Aug 22, 2013 3:08 pm

THX i check it.
TWiegand
Posts: 20
Joined: Thu Aug 22, 2013 3:08 pm

OK, it works with the external Images.
Post Reply