模板:Codepen:修订间差异
来自康健生活
无编辑摘要 |
无编辑摘要 |
||
| (未显示同一用户的130个中间版本) | |||
| 第1行: | 第1行: | ||
<noinclude>{{Documentation}}</noinclude> | <templatestyles src="Codepen/styles.css" /><noinclude>{{Documentation}}</noinclude><includeonly><div class="wiki-codepen" style="height:{{{height|}}}px;">{{Double-columns| | ||
<includeonly><div class="wiki-codepen">{{ | <tabs> | ||
|{{#tab: | {{#if:{{{html|}}}| | ||
{{#tag:tab|{{#tag:syntaxhighlight|{{{html|}}}|lang=html}}|name='html'}}|}} | |||
{{#if:{{{style|}}}| | |||
{{#tag:tab|{{#tag:syntaxhighlight|{{{style|}}}|lang=css}}|name='style'}}|}} | |||
{{#if:{{{script|}}}| | |||
{{#tag:tab|{{#tag:syntaxhighlight|{{{script|}}}|lang=javascript}}|name='script'}}|}} | |||
</tabs> | |||
|{{#tag:html| | |||
{{#tag:html|{{#tag:script|function {{{id|}}}(_){ | |||
const target = _.contentDocument <nowiki>||</nowiki> _.contentWindow.document; | |||
target.body.innerHTML = `{{#if:{{{style|}}}|{{#tag:style|{{{style|}}}|type=text/css}}|}}{{#if:{{{html|}}}|{{{html|}}}|}}`; | |||
const ele = document.createElement('script'); | |||
ele.type = 'text/javascript'; | |||
ele.innerHTML = `{{{script|}}}` <nowiki>||</nowiki> ''; | |||
target.body.appendChild(ele); | |||
}|type='text/javascript'}}}} | |||
| | <iframe class="wiki-codepen-iframe" onload="{{{id|}}}(this)"></iframe> | ||
|class=wiki-codepen-preview}} | |||
{{ | }}</div></includeonly> | ||
</includeonly> | |||