Created
April 24, 2015 15:15
-
-
Save mshanemc/5c7dd7703037d91e9e6e to your computer and use it in GitHub Desktop.
responsive visualforce Iframes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page showHeader="false" sidebar="false" standardStylesheets="false" docType="html-5.0"> | |
<script type="text/javascript"> | |
//redirect to desktop-only version of page | |
if( (typeof sforce == 'undefined') || (sforce == null) ) { | |
if ({!isnull($CurrentPage.parameters.iframeurl)}){ | |
window.location.assign("{!$Page.responsiveIframeDesktop}"); | |
} else { | |
window.location.assign("{!$Page.responsiveIframeDesktop}?iframeurl={!$CurrentPage.parameters.iframeurl}"); | |
} | |
} | |
</script> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
</head> | |
<apex:iframe src="{!if(isnull($CurrentPage.parameters.iframeurl), 'https://www.salesforce.com', $CurrentPage.parameters.iframeurl)}" id="iframe" width="100%" height="4000px"/> | |
</apex:page> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page showHeader="true" sidebar="false" standardStylesheets="true" docType="html-5.0"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
</head> | |
<apex:iframe src="{!if(isnull($CurrentPage.parameters.iframeurl), 'https://www.salesforce.com', $CurrentPage.parameters.iframeurl)}" id="iframe" width="100%" height="4000px"/> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment