Created
August 20, 2014 15:39
-
-
Save stevenfollis/0343b45a40818976c14b to your computer and use it in GitHub Desktop.
SP2013 Resize AppPart iFrames from host page with jQuery
This file contains 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
// select and loop through all iframes inside of webparts | |
$('.ms-WPBody iframe').each(function(i, frame) { | |
// define a variable to hold the new width | |
var newWidth; | |
// starting with the iframe, search up the DOM for the closest webpart zone | |
// then find its width and store it | |
newWidth = $(frame).closest('.ms-webpart-zone').width(); | |
// set the iframe to the new width | |
$(frame).width(newWidth); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment