iframe
Log-in
|
Sandbox
:
iframe
Top Menu
Show
:
Comments
Attachments
History
Information
Print
:
Print
Print preview
Export as PDF
Export as RTF
Export as HTML
Export as XAR
Wiki code for
iframe
Hide Line numbers
1: 2: <div id="media_viewer"> 3: <iframe src="$xwiki.getURL("Macros.JW-Player", "view", "xpage=plain")" 4: onload="try { setMultimediasIframeSize(); } catch(e) { alert(’iframe onload error: ’+e+’ ...’); return false; }" 5: id="multimedia_iframe" 6: name="multimedia_iframe" 7: style="height: 600px; width: 100%;" 8: scrolling="auto" ## needed to make setMultimediasIframeSize() work -- "no" doesn’t reliably work across browsers 9: marginheight="0" 10: marginwidth="0" 11: frameborder="0" > 12: <h2>Sorry, your browser doesn’t support iframes. Multimedia functionality disabled.</h2> ## fallback text for browsers that don’t support iframe 13: </iframe></div> 14: {pre}<script language="javascript" type="text/javascript"> 15: /* <![CDATA[ */ 16: ############################################################################## 17: ## resize the multimedia iframe to match size of contents. 18: ## this is called on <iframe id="multimedia_iframe">-onload 19: ############################################################################## 20: function setMultimediasIframeSize() { 21: var iframe_o = document.getElementById(’multimedia_iframe’); 22: try { 23: if (iframe_o != null) { 24: iframe_o.height = iframe_o.style.height = 50; ## attempt reset because FF behavior is grow-only 25: } 26: ## this is portable way of getting at iframe DOM content per 27: ## http://www.mabaloo.com/Web-Development/Creating-controlling-and-manipulating-an-Iframe-through-JavaScript.html 28: var doc_o = (iframe_o.contentWindow || iframe_o.contentDocument); 29: if (doc_o.document) { 30: doc_o = doc_o.document; 31: } 32: ## the iframe needs more space than ’scrollHeight’ says, or we get 33: ## scrollbars. 5 seems to accomodate the inner and outer margin, and 34: ## inner and outer border, with one pixel for the margin itself. 35: ## nb: iframe_o.style.height only works in IE, does nothing in FF. 36: ## do em both for good measure?! 37: if (iframe_o != null) { 38: iframe_o.height = iframe_o.style.height = doc_o.body.scrollHeight + 5; 39: } 40: } 41: catch(e) { 42: if (iframe_o != null) { 43: iframe_o.height = iframe_o.style.height = 600; ## bigger default height value if things go wrong 44: } 45: } 46: } 47: /* ]]> */ 48: </script>{/pre}
Search
Navigation:
Home
What's New
Site Timeline
Featured Apps:
NPR Podcasts
Fav Music Podcasts
KCRW Podcasts
Exhibit Presidents
Topics:
NPM's Blog ...
Site News
Photos
Todos
Sandbox
Fedora10
Timeline
Exhibit
CreateResources
Recently Modified
$rdoc.displayTitle
|
XWikiPreferences
|
XWikiAllGroup
|
NielsMayer.com
|
ShellScriptReturningListOfOldKernels
Recently Created
ShellScriptReturningListOfOldKernels
|
HowToHackPluginsForFireFox3_5_x86_64
|
FeedExperiment4
|
Thinbox
|
JWPlayer2