Screen Rotate on Mobile

Screen Rotate on Mobile was created by Alexi

Posted 8 years 3 weeks ago #33051
Hello

I would like to ask you for a small support.

When I'm using your plugin with size 90% 90% on mobile phones (Android, IOS)
it works fine as long as I don't change screen orientation from vertical
to horizontal or opposite.

When I do that, light box change it size to a very tiny one which I think
is a some sort of bug.

I wanted to solve this problem by myself but I have some problems.

I think it would be possible to use this Javascript code:
window.onorientationchange = function() { window.location.reload(); };

Which would force lightbox window to reopen and adjust it size again
when screen orientation is changed.

But I'm not sure where I can put it so it would only work for lightbox and
not whole website (because right now it reloads whole website after screen orientation has changed not only lightbox content).

I would be very grateful for your tip.

Best regards,
Alexi
by Alexi

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Screen Rotate on Mobile

Posted 8 years 3 weeks ago #33064
Hi
Please give me your url so that I can check this, because I don't really understand what happen here
CEd

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Replied by Alexi on topic Screen Rotate on Mobile

Posted 8 years 3 weeks ago #33120
Thank you for your reply. I will try to explain it more clearly.


Take your phone f.e. with Android.

Turn on auto rotate rotate function in your phone.

With this function on, your phone will turn your screen 90 degree automatically
when you flip your screen from vertical to horizontal view/mode.


Vertical is a standard phone screen position (width is smaller than height)
Horizontal is rotated panoramic phone position (width is bigger than height)


1. So when your phone is in vertical position, please
open your own demo website on your phone:

www.joomlack.fr/en/joomla-extensions/mediabox-ck

2. Click on one of example images - lightbox will open with image,
now flip your phone to horizontal mode (phone will turn the image).

The image in lightbox will become centered, but it width will be exactly
the same is in vertical mode.


No please repeat step 1&2 but start when your phone is in horizontal mode
and then after you will open ligthbox rotate it to vertical.


I hope this will help you explain what I mean.

If I want to set light box to f.e. size 80% width and 80% height this is
no longer working on mobile when you flip the screen.


I believe the script should recognize that in case it is mobile (phone or
tablet) and it was flipped - lightbox content size should be adapted
to the new size instead become centered.

This may not be a problem when you use lightbox to display image but
when you use it to show external content (f.e. website or video)
it makes lightbox content to small that it was expected.

BR,
A
by Alexi

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Screen Rotate on Mobile

Posted 8 years 3 weeks ago #33207
ok, I have just tested
- opened vertically, and turn 90 to switch to horizontally
- opened horizontally, and turn 90 to switch to vertically

on both cases, by my side the image adapts itseflf. I mean that in horizontal (landscape mode) the image is bigger

if I understand on your side, the image is not bigger and does not change its size

I have also tested with the Google Chrome mobile emulator, and it works also with it
CEd

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Time to create page: 0.808 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 809 guests and 2 members online