Sie sind nicht angemeldet.

1

Montag, 14. November 2011, 15:14

Width/Height as a Percentage While Maintaining Aspect Ratio

Hi, I was wondering if it were possible to set the width of a plugin as a percentage, and have it resize while maintaining its aspect ratio.

To put this into context, I have a "Gallery" button I wish to display within a tour, and I want it to be 20% of the screen width for any user. The problem that I have with this is that if I set the width to a percentage, the height remains constant and it stretches and distorts with the browser.

Is there any way to set the XML so that the width will remain a constant 20%, and the height scale according to the width? Currently the only way I can see of doing this is with an onresize event, but that seems incredibly long-winded and messy.

Any help will be appreciated.

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Montag, 14. November 2011, 15:30

Set one to percent, set the other one to "PROP"
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Montag, 14. November 2011, 15:32

Set one to percent, set the other one to "PROP"
Works perfectly! Thanks so much.