|
");
window.frames["iframe_toc"+sid].document.write(decodeHtml($("pre#stepCodePre"+sid).html()));
window.frames["iframe_toc"+sid].document.close();
$(window.frames["iframe_toc"+sid]).load(function(){
$("#iframe_toc"+sid).height($("#iframe_toc"+sid).contents().find("body").height()+(showittryitheight));
});
$("#iframe_toc"+sid).height($("#iframe_toc"+sid).contents().find("body").height()+(showittryitheight));
}
$("input.tocName").hover(function(){
$(this).select();
});
function refresh(){
var sid = tocstepids.shift();
if(null!=sid)
refreshIframe(sid);
else
go2ArchorFlag = true;
}
var t = setInterval(refresh,300);
// $("div.steptoc iframe").height($(showittryitheight+50));
});
效果 |
说明 |
示例代码 |
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<ul class="list-group">
<li class="list-group-item">回锅肉</li>
<li class="list-group-item">烧烤</li>
<li class="list-group-item">鱼香肉丝</li>
<li class="list-group-item">麻婆豆腐</li>
<li class="list-group-item">夫妻肺片</li>
</ul>
|
基本列表组
|
示例代码
|
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<ul class="list-group">
<li class="list-group-item"><span class="badge">3</span>回锅肉</li>
<li class="list-group-item"><span class="badge">14</span>烧烤</li>
<li class="list-group-item"><span class="badge">15</span>鱼香肉丝</li>
<li class="list-group-item"><span class="badge">92</span>麻婆豆腐</li>
<li class="list-group-item"><span class="badge">6</span>夫妻肺片</li>
</ul>
|
徽记
|
示例代码
|
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<a href="#" class="list-group-item active">
回锅肉
</a>
<a href="#" class="list-group-item">烧烤</a>
<a href="#" class="list-group-item">鱼香肉丝</a>
<a href="#" class="list-group-item">麻婆豆腐</a>
<a href="#" class="list-group-item">夫妻肺片</a>
</div>
|
链接
|
示例代码
|
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<button type="button" class="list-group-item active">
回锅肉
</button>
<button type="button" class="list-group-item">烧烤</button>
<button type="button" class="list-group-item">鱼香肉丝</button>
<button type="button" class="list-group-item">麻婆豆腐</button>
<button type="button" class="list-group-item">夫妻肺片</button>
</div>
|
按钮
|
示例代码
|
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<a href="#" class="list-group-item active">
回锅肉
</a>
<a href="#" class="list-group-item list-group-item-success">烧烤</a>
<a href="#" class="list-group-item list-group-item-info">鱼香肉丝</a>
<a href="#" class="list-group-item list-group-item-warning">麻婆豆腐</a>
<a href="#" class="list-group-item list-group-item-danger">夫妻肺片</a>
</div>
|
颜色
|
示例代码
|
示例
1
:
基本列表组
示例
2
:
徽记
示例
3
:
链接
示例
4
:
按钮
示例
5
:
颜色
");
window.frames["iframe_show2990"].document.write(decodeHtml($("textarea#stepcodeTextarea2990").val()));
window.frames["iframe_show2990"].document.close();
$(window.frames["iframe_show2990"]).load(function(){
$("#iframe_show2990").height($("#iframe_show2990").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2990").height($("#iframe_show2990").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<ul class="list-group">
<li class="list-group-item">回锅肉</li>
<li class="list-group-item">烧烤</li>
<li class="list-group-item">鱼香肉丝</li>
<li class="list-group-item">麻婆豆腐</li>
<li class="list-group-item">夫妻肺片</li>
</ul>
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<ul class="list-group">
<li class="list-group-item">回锅肉</li>
<li class="list-group-item">烧烤</li>
<li class="list-group-item">鱼香肉丝</li>
<li class="list-group-item">麻婆豆腐</li>
<li class="list-group-item">夫妻肺片</li>
</ul>
");
window.frames["iframe2990"].document.write(decodeHtml(code2990));
window.frames["iframe2990"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2990"]).load(function(){
$("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight);
});
$("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight);
alreadyWriteCode2990 = code2990;
$("#rendering2990").hide();
$("#rendered2990").show();
}
var tRereshRetry2DemoPanel2990 = setInterval(rereshRetry2DemoPanel2990,1000);
var binded2990 = false;
$("textarea#stepcodeTextarea2990").keyup(function(){
if(!binded2990){
$(window).bind('beforeunload',function(){
binded2990 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2990 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2990!=newCode){
// window.frames["iframe2990"].document.write("
");
// window.frames["iframe2990"].document.write(decodeHtml($("textarea#stepcodeTextarea2990").val()));
// window.frames["iframe2990"].document.close();
// $(window.frames["iframe2990"]).load(function(){
// $("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight);
// });
// code2990 = newCode;
// }
});
$(".tryButton2990").click(function(){
$("#tryDiv2990").show();
$("#stepcodeTextarea2990").focus();
$("#stepcodeTextarea2990").height(200);
$("#iframe2990").height(0);
window.frames["iframe2990"].document.write("
");
window.frames["iframe2990"].document.write(decodeHtml($("textarea#stepcodeTextarea2990").val()));
window.frames["iframe2990"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2990"]).load(function(){
$("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight);
});
$("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2990.focus();
editor2990.setSize(null, "250");
$("#rendering2990").hide();
$("#rendered2990").hide();
});
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor2990 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2990"), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode:"text/html",
theme:"eclipse",
selectionPointer: true,
lineWrapping: true,
extraKeys: {
"Alt-/": "autocomplete",
"Ctrl-F": "findPersistent",
"F8": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
editor2990.on("change",function(doc){
if(!binded2990){
$(window).bind('beforeunload',function(){
binded2990 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2990 = newCode;
$("textarea#stepcodeTextarea2990").val(newCode);
if(alreadyWriteCode2990!=code2990){
lastModifedTime2990 = new Date().getTime();
$("#rendering2990").show();
$("#rendered2990").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2990 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2990.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2990").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2991"].document.write(decodeHtml($("textarea#stepcodeTextarea2991").val()));
window.frames["iframe_show2991"].document.close();
$(window.frames["iframe_show2991"]).load(function(){
$("#iframe_show2991").height($("#iframe_show2991").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2991").height($("#iframe_show2991").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<ul class="list-group">
<li class="list-group-item"><span class="badge">3</span>回锅肉</li>
<li class="list-group-item"><span class="badge">14</span>烧烤</li>
<li class="list-group-item"><span class="badge">15</span>鱼香肉丝</li>
<li class="list-group-item"><span class="badge">92</span>麻婆豆腐</li>
<li class="list-group-item"><span class="badge">6</span>夫妻肺片</li>
</ul>
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<ul class="list-group">
<li class="list-group-item"><span class="badge">3</span>回锅肉</li>
<li class="list-group-item"><span class="badge">14</span>烧烤</li>
<li class="list-group-item"><span class="badge">15</span>鱼香肉丝</li>
<li class="list-group-item"><span class="badge">92</span>麻婆豆腐</li>
<li class="list-group-item"><span class="badge">6</span>夫妻肺片</li>
</ul>
");
window.frames["iframe2991"].document.write(decodeHtml(code2991));
window.frames["iframe2991"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2991"]).load(function(){
$("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight);
});
$("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight);
alreadyWriteCode2991 = code2991;
$("#rendering2991").hide();
$("#rendered2991").show();
}
var tRereshRetry2DemoPanel2991 = setInterval(rereshRetry2DemoPanel2991,1000);
var binded2991 = false;
$("textarea#stepcodeTextarea2991").keyup(function(){
if(!binded2991){
$(window).bind('beforeunload',function(){
binded2991 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2991 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2991!=newCode){
// window.frames["iframe2991"].document.write("
");
// window.frames["iframe2991"].document.write(decodeHtml($("textarea#stepcodeTextarea2991").val()));
// window.frames["iframe2991"].document.close();
// $(window.frames["iframe2991"]).load(function(){
// $("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight);
// });
// code2991 = newCode;
// }
});
$(".tryButton2991").click(function(){
$("#tryDiv2991").show();
$("#stepcodeTextarea2991").focus();
$("#stepcodeTextarea2991").height(200);
$("#iframe2991").height(0);
window.frames["iframe2991"].document.write("
");
window.frames["iframe2991"].document.write(decodeHtml($("textarea#stepcodeTextarea2991").val()));
window.frames["iframe2991"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2991"]).load(function(){
$("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight);
});
$("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2991.focus();
editor2991.setSize(null, "250");
$("#rendering2991").hide();
$("#rendered2991").hide();
});
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor2991 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2991"), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode:"text/html",
theme:"eclipse",
selectionPointer: true,
lineWrapping: true,
extraKeys: {
"Alt-/": "autocomplete",
"Ctrl-F": "findPersistent",
"F8": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
editor2991.on("change",function(doc){
if(!binded2991){
$(window).bind('beforeunload',function(){
binded2991 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2991 = newCode;
$("textarea#stepcodeTextarea2991").val(newCode);
if(alreadyWriteCode2991!=code2991){
lastModifedTime2991 = new Date().getTime();
$("#rendering2991").show();
$("#rendered2991").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2991 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2991.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2991").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2992"].document.write(decodeHtml($("textarea#stepcodeTextarea2992").val()));
window.frames["iframe_show2992"].document.close();
$(window.frames["iframe_show2992"]).load(function(){
$("#iframe_show2992").height($("#iframe_show2992").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2992").height($("#iframe_show2992").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<a href="#" class="list-group-item active">
回锅肉
</a>
<a href="#" class="list-group-item">烧烤</a>
<a href="#" class="list-group-item">鱼香肉丝</a>
<a href="#" class="list-group-item">麻婆豆腐</a>
<a href="#" class="list-group-item">夫妻肺片</a>
</div>
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<a href="#" class="list-group-item active">
回锅肉
</a>
<a href="#" class="list-group-item">烧烤</a>
<a href="#" class="list-group-item">鱼香肉丝</a>
<a href="#" class="list-group-item">麻婆豆腐</a>
<a href="#" class="list-group-item">夫妻肺片</a>
</div>
");
window.frames["iframe2992"].document.write(decodeHtml(code2992));
window.frames["iframe2992"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2992"]).load(function(){
$("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight);
});
$("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight);
alreadyWriteCode2992 = code2992;
$("#rendering2992").hide();
$("#rendered2992").show();
}
var tRereshRetry2DemoPanel2992 = setInterval(rereshRetry2DemoPanel2992,1000);
var binded2992 = false;
$("textarea#stepcodeTextarea2992").keyup(function(){
if(!binded2992){
$(window).bind('beforeunload',function(){
binded2992 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2992 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2992!=newCode){
// window.frames["iframe2992"].document.write("
");
// window.frames["iframe2992"].document.write(decodeHtml($("textarea#stepcodeTextarea2992").val()));
// window.frames["iframe2992"].document.close();
// $(window.frames["iframe2992"]).load(function(){
// $("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight);
// });
// code2992 = newCode;
// }
});
$(".tryButton2992").click(function(){
$("#tryDiv2992").show();
$("#stepcodeTextarea2992").focus();
$("#stepcodeTextarea2992").height(200);
$("#iframe2992").height(0);
window.frames["iframe2992"].document.write("
");
window.frames["iframe2992"].document.write(decodeHtml($("textarea#stepcodeTextarea2992").val()));
window.frames["iframe2992"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2992"]).load(function(){
$("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight);
});
$("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2992.focus();
editor2992.setSize(null, "250");
$("#rendering2992").hide();
$("#rendered2992").hide();
});
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor2992 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2992"), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode:"text/html",
theme:"eclipse",
selectionPointer: true,
lineWrapping: true,
extraKeys: {
"Alt-/": "autocomplete",
"Ctrl-F": "findPersistent",
"F8": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
editor2992.on("change",function(doc){
if(!binded2992){
$(window).bind('beforeunload',function(){
binded2992 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2992 = newCode;
$("textarea#stepcodeTextarea2992").val(newCode);
if(alreadyWriteCode2992!=code2992){
lastModifedTime2992 = new Date().getTime();
$("#rendering2992").show();
$("#rendered2992").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2992 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2992.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2992").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2993"].document.write(decodeHtml($("textarea#stepcodeTextarea2993").val()));
window.frames["iframe_show2993"].document.close();
$(window.frames["iframe_show2993"]).load(function(){
$("#iframe_show2993").height($("#iframe_show2993").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2993").height($("#iframe_show2993").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<button type="button" class="list-group-item active">
回锅肉
</button>
<button type="button" class="list-group-item">烧烤</button>
<button type="button" class="list-group-item">鱼香肉丝</button>
<button type="button" class="list-group-item">麻婆豆腐</button>
<button type="button" class="list-group-item">夫妻肺片</button>
</div>
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<button type="button" class="list-group-item active">
回锅肉
</button>
<button type="button" class="list-group-item">烧烤</button>
<button type="button" class="list-group-item">鱼香肉丝</button>
<button type="button" class="list-group-item">麻婆豆腐</button>
<button type="button" class="list-group-item">夫妻肺片</button>
</div>
");
window.frames["iframe2993"].document.write(decodeHtml(code2993));
window.frames["iframe2993"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2993"]).load(function(){
$("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight);
});
$("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight);
alreadyWriteCode2993 = code2993;
$("#rendering2993").hide();
$("#rendered2993").show();
}
var tRereshRetry2DemoPanel2993 = setInterval(rereshRetry2DemoPanel2993,1000);
var binded2993 = false;
$("textarea#stepcodeTextarea2993").keyup(function(){
if(!binded2993){
$(window).bind('beforeunload',function(){
binded2993 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2993 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2993!=newCode){
// window.frames["iframe2993"].document.write("
");
// window.frames["iframe2993"].document.write(decodeHtml($("textarea#stepcodeTextarea2993").val()));
// window.frames["iframe2993"].document.close();
// $(window.frames["iframe2993"]).load(function(){
// $("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight);
// });
// code2993 = newCode;
// }
});
$(".tryButton2993").click(function(){
$("#tryDiv2993").show();
$("#stepcodeTextarea2993").focus();
$("#stepcodeTextarea2993").height(200);
$("#iframe2993").height(0);
window.frames["iframe2993"].document.write("
");
window.frames["iframe2993"].document.write(decodeHtml($("textarea#stepcodeTextarea2993").val()));
window.frames["iframe2993"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2993"]).load(function(){
$("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight);
});
$("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2993.focus();
editor2993.setSize(null, "250");
$("#rendering2993").hide();
$("#rendered2993").hide();
});
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor2993 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2993"), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode:"text/html",
theme:"eclipse",
selectionPointer: true,
lineWrapping: true,
extraKeys: {
"Alt-/": "autocomplete",
"Ctrl-F": "findPersistent",
"F8": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
editor2993.on("change",function(doc){
if(!binded2993){
$(window).bind('beforeunload',function(){
binded2993 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2993 = newCode;
$("textarea#stepcodeTextarea2993").val(newCode);
if(alreadyWriteCode2993!=code2993){
lastModifedTime2993 = new Date().getTime();
$("#rendering2993").show();
$("#rendered2993").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2993 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2993.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2993").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2994"].document.write(decodeHtml($("textarea#stepcodeTextarea2994").val()));
window.frames["iframe_show2994"].document.close();
$(window.frames["iframe_show2994"]).load(function(){
$("#iframe_show2994").height($("#iframe_show2994").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2994").height($("#iframe_show2994").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<a href="#" class="list-group-item active">
回锅肉
</a>
<a href="#" class="list-group-item list-group-item-success">烧烤</a>
<a href="#" class="list-group-item list-group-item-info">鱼香肉丝</a>
<a href="#" class="list-group-item list-group-item-warning">麻婆豆腐</a>
<a href="#" class="list-group-item list-group-item-danger">夫妻肺片</a>
</div>
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="list-group">
<a href="#" class="list-group-item active">
回锅肉
</a>
<a href="#" class="list-group-item list-group-item-success">烧烤</a>
<a href="#" class="list-group-item list-group-item-info">鱼香肉丝</a>
<a href="#" class="list-group-item list-group-item-warning">麻婆豆腐</a>
<a href="#" class="list-group-item list-group-item-danger">夫妻肺片</a>
</div>
");
window.frames["iframe2994"].document.write(decodeHtml(code2994));
window.frames["iframe2994"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2994"]).load(function(){
$("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight);
});
$("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight);
alreadyWriteCode2994 = code2994;
$("#rendering2994").hide();
$("#rendered2994").show();
}
var tRereshRetry2DemoPanel2994 = setInterval(rereshRetry2DemoPanel2994,1000);
var binded2994 = false;
$("textarea#stepcodeTextarea2994").keyup(function(){
if(!binded2994){
$(window).bind('beforeunload',function(){
binded2994 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2994 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2994!=newCode){
// window.frames["iframe2994"].document.write("
");
// window.frames["iframe2994"].document.write(decodeHtml($("textarea#stepcodeTextarea2994").val()));
// window.frames["iframe2994"].document.close();
// $(window.frames["iframe2994"]).load(function(){
// $("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight);
// });
// code2994 = newCode;
// }
});
$(".tryButton2994").click(function(){
$("#tryDiv2994").show();
$("#stepcodeTextarea2994").focus();
$("#stepcodeTextarea2994").height(200);
$("#iframe2994").height(0);
window.frames["iframe2994"].document.write("
");
window.frames["iframe2994"].document.write(decodeHtml($("textarea#stepcodeTextarea2994").val()));
window.frames["iframe2994"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2994"]).load(function(){
$("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight);
});
$("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2994.focus();
editor2994.setSize(null, "250");
$("#rendering2994").hide();
$("#rendered2994").hide();
});
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor2994 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2994"), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode:"text/html",
theme:"eclipse",
selectionPointer: true,
lineWrapping: true,
extraKeys: {
"Alt-/": "autocomplete",
"Ctrl-F": "findPersistent",
"F8": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
editor2994.on("change",function(doc){
if(!binded2994){
$(window).bind('beforeunload',function(){
binded2994 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2994 = newCode;
$("textarea#stepcodeTextarea2994").val(newCode);
if(alreadyWriteCode2994!=code2994){
lastModifedTime2994 = new Date().getTime();
$("#rendering2994").show();
$("#rendered2994").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2994 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2994.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2994").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|