- Posts: 25
How To / General
iFrame Responsiveness Issues on Mobile Devices
- pcomelearning
- Topic Author
- Offline
- Junior Member
-
Less
More
9 years 11 months ago #1
by pcomelearning
iFrame Responsiveness Issues on Mobile Devices was created by pcomelearning
Hello,
We are using a Snap template for Moodle and running into responsiveness issues with the iFrame. Not sure if it is even possible to do with an iFrame, but we've been having issues getting the content to focus at the top of the div or scroll to the top of the page when a link to an anchor is clicked on a mobile device. Another related issue is that autoheight does not format correctly on mobile devices...instead of sizing to fit all of the content, the iFrame is only showing a small portion. We have to set the height manually to avoid the issue with the iFrame not doing the auto height correctly.
Is it possible to detect the change in dimensions of the content and to scroll(0,0) when the change is detected? I've been playing with different settings for the iFrame in both the Configuration, default.php, and autoheight.js without any luck. Is the problem that the iFrame needs to be reloaded when the dimensions of the content change? Is it possible to use the jQuery load function in place of the iFrame with better results? If we can get the browser to detect the change in content space, it should be easy to get it to scroll to the top of the page as well :huh: . Any ideas, solutions, or input is appreciated.
Thank you,
Miles Exner
P.S. The video below describes the issue on Mobile Devices, specifically iPhone (any browser) in this case. It was working fine on Android, but now it seems to be a problem on both for some strange reason. Works fine on desktop, even when testing the different mobile devices and responsiveness in Chrome.
We are using a Snap template for Moodle and running into responsiveness issues with the iFrame. Not sure if it is even possible to do with an iFrame, but we've been having issues getting the content to focus at the top of the div or scroll to the top of the page when a link to an anchor is clicked on a mobile device. Another related issue is that autoheight does not format correctly on mobile devices...instead of sizing to fit all of the content, the iFrame is only showing a small portion. We have to set the height manually to avoid the issue with the iFrame not doing the auto height correctly.
Is it possible to detect the change in dimensions of the content and to scroll(0,0) when the change is detected? I've been playing with different settings for the iFrame in both the Configuration, default.php, and autoheight.js without any luck. Is the problem that the iFrame needs to be reloaded when the dimensions of the content change? Is it possible to use the jQuery load function in place of the iFrame with better results? If we can get the browser to detect the change in content space, it should be easy to get it to scroll to the top of the page as well :huh: . Any ideas, solutions, or input is appreciated.
Thank you,
Miles Exner
P.S. The video below describes the issue on Mobile Devices, specifically iPhone (any browser) in this case. It was working fine on Android, but now it seems to be a problem on both for some strange reason. Works fine on desktop, even when testing the different mobile devices and responsiveness in Chrome.
Please Log in or Create an account to join the conversation.
- pcomelearning
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 25
9 years 11 months ago - 9 years 11 months ago #2
by pcomelearning
Replied by pcomelearning on topic iFrame Responsiveness Issues on Mobile Devices
Update:
We have found a couple of solutions. One was to create a script that scrolls to the top everytime a navigation link is clicked in moodle. The simplest solution is to stop using the iFrame.
We have found a couple of solutions. One was to create a script that scrolls to the top everytime a navigation link is clicked in moodle. The simplest solution is to stop using the iFrame.
Last edit: 9 years 11 months ago by pcomelearning.
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7926
9 years 11 months ago #3
by Antonio Durán
Replied by Antonio Durán on topic iFrame Responsiveness Issues on Mobile Devices
Hello.
Unfortunately, I am no expert at all in Javascript and this stuff, so currently I don't really have the knowledge to make improvements to the wrapper.
It seems you have some ideas, so if you are able to make any improvements, please let us know.
Which Joomdle version are you using? 1.0.6 included a little change about scroll(0,0) contributed by a Joomdle user, that seems similar to what you suggest.
I think mobile devices are more difficult for the wrapper, as all the reponsive stuff needs to happen in both places, and I don't know if that's even possible with an iframe.
ps: I saw no video
Unfortunately, I am no expert at all in Javascript and this stuff, so currently I don't really have the knowledge to make improvements to the wrapper.
It seems you have some ideas, so if you are able to make any improvements, please let us know.
Which Joomdle version are you using? 1.0.6 included a little change about scroll(0,0) contributed by a Joomdle user, that seems similar to what you suggest.
I think mobile devices are more difficult for the wrapper, as all the reponsive stuff needs to happen in both places, and I don't know if that's even possible with an iframe.
ps: I saw no video
Please Log in or Create an account to join the conversation.