Known Issue: Scrolling on a SharePoint Page Viewer Web Part using a Mobile Device does not Work
KB001760
PRODUCT
Issue:
SmartForms can be inserted in SharePoint pages using K2 Form Viewer or K2 SmartForms Viewer, which inherits from the SharePoint Page Viewer web part. When the form is viewed on a mobile device, such as an iPad, the scroll bar is not available which makes the form unusable. To resolve this issue, you must enable page scrolling by adding a script to the SharePoint page hosting the K2 Form Viewer. Follow the steps detailed in the workaround below:
Workaround:
- As a SharePoint administrator edit the SharePoint page that contains the K2 Forms Viewer web part.
- In the ribbon choose Insert -> Embed Code.
- Paste the following code:
Note: - The sample script below shows the configuration for an iPad. Customize the script if you are using a different mobile device.
- The widths and heights in the script can be adjusted to ensure the form displays correctly on the targeted devices.
<script type="text/javascript">
var is_iPad = navigator.userAgent.match(/iPad/i) != null;
function _fixIframeScrolling()
{
var iframe = document.getElementsByTagName("iframe")[0];
iframe.setAttribute("scrolling", "yes");
iframe.height = "100%";
iframe.width = "100%";
iframe.style.cssText = "display:block;";
iframe.parentElement.style.cssText = "height: 450px; width: 750px; max-width: 750px; max-height: 450px; overflow: auto; -webkit-overflow-scrolling: touch;";
iframe.parentElement.parentElement.style.cssText = "height: 460px; width: 760px;";
}
if(is_iPad)
{
_spBodyOnLoadFunctionNames.push("_fixIframeScrolling")
}
</script> - Click Insert.
- Save the page.