|
");
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));
});
示例
1
:
强调的背景
示例
2
:
成功操作文字的背景
示例
3
:
信息提示文字的背景
示例
4
:
警告提示文字的背景
示例
5
:
危险提示文字的背景
");
window.frames["iframe_show1258"].document.write(decodeHtml($("textarea#stepcodeTextarea1258").val()));
window.frames["iframe_show1258"].document.close();
$(window.frames["iframe_show1258"]).load(function(){
$("#iframe_show1258").height($("#iframe_show1258").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1258").height($("#iframe_show1258").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>
<p class="bg-primary">强调</p>
<!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>
<p class="bg-primary">强调</p>
");
window.frames["iframe1258"].document.write(decodeHtml(code1258));
window.frames["iframe1258"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1258"]).load(function(){
$("#iframe1258").height($("#iframe1258").contents().find("body").height()+showittryitheight);
});
$("#iframe1258").height($("#iframe1258").contents().find("body").height()+showittryitheight);
alreadyWriteCode1258 = code1258;
$("#rendering1258").hide();
$("#rendered1258").show();
}
var tRereshRetry2DemoPanel1258 = setInterval(rereshRetry2DemoPanel1258,1000);
var binded1258 = false;
$("textarea#stepcodeTextarea1258").keyup(function(){
if(!binded1258){
$(window).bind('beforeunload',function(){
binded1258 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1258 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1258!=newCode){
// window.frames["iframe1258"].document.write("
");
// window.frames["iframe1258"].document.write(decodeHtml($("textarea#stepcodeTextarea1258").val()));
// window.frames["iframe1258"].document.close();
// $(window.frames["iframe1258"]).load(function(){
// $("#iframe1258").height($("#iframe1258").contents().find("body").height()+showittryitheight);
// });
// code1258 = newCode;
// }
});
$(".tryButton1258").click(function(){
$("#tryDiv1258").show();
$("#stepcodeTextarea1258").focus();
$("#stepcodeTextarea1258").height(200);
$("#iframe1258").height(0);
window.frames["iframe1258"].document.write("
");
window.frames["iframe1258"].document.write(decodeHtml($("textarea#stepcodeTextarea1258").val()));
window.frames["iframe1258"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1258"]).load(function(){
$("#iframe1258").height($("#iframe1258").contents().find("body").height()+showittryitheight);
});
$("#iframe1258").height($("#iframe1258").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1258.focus();
editor1258.setSize(null, "250");
$("#rendering1258").hide();
$("#rendered1258").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 editor1258 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1258"), {
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);
}
}
});
editor1258.on("change",function(doc){
if(!binded1258){
$(window).bind('beforeunload',function(){
binded1258 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1258 = newCode;
$("textarea#stepcodeTextarea1258").val(newCode);
if(alreadyWriteCode1258!=code1258){
lastModifedTime1258 = new Date().getTime();
$("#rendering1258").show();
$("#rendered1258").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1258 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1258.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1258").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show1259"].document.write(decodeHtml($("textarea#stepcodeTextarea1259").val()));
window.frames["iframe_show1259"].document.close();
$(window.frames["iframe_show1259"]).load(function(){
$("#iframe_show1259").height($("#iframe_show1259").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1259").height($("#iframe_show1259").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>
<p class="bg-success">操作成功</p>
<!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>
<p class="bg-success">操作成功</p>
");
window.frames["iframe1259"].document.write(decodeHtml(code1259));
window.frames["iframe1259"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1259"]).load(function(){
$("#iframe1259").height($("#iframe1259").contents().find("body").height()+showittryitheight);
});
$("#iframe1259").height($("#iframe1259").contents().find("body").height()+showittryitheight);
alreadyWriteCode1259 = code1259;
$("#rendering1259").hide();
$("#rendered1259").show();
}
var tRereshRetry2DemoPanel1259 = setInterval(rereshRetry2DemoPanel1259,1000);
var binded1259 = false;
$("textarea#stepcodeTextarea1259").keyup(function(){
if(!binded1259){
$(window).bind('beforeunload',function(){
binded1259 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1259 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1259!=newCode){
// window.frames["iframe1259"].document.write("
");
// window.frames["iframe1259"].document.write(decodeHtml($("textarea#stepcodeTextarea1259").val()));
// window.frames["iframe1259"].document.close();
// $(window.frames["iframe1259"]).load(function(){
// $("#iframe1259").height($("#iframe1259").contents().find("body").height()+showittryitheight);
// });
// code1259 = newCode;
// }
});
$(".tryButton1259").click(function(){
$("#tryDiv1259").show();
$("#stepcodeTextarea1259").focus();
$("#stepcodeTextarea1259").height(200);
$("#iframe1259").height(0);
window.frames["iframe1259"].document.write("
");
window.frames["iframe1259"].document.write(decodeHtml($("textarea#stepcodeTextarea1259").val()));
window.frames["iframe1259"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1259"]).load(function(){
$("#iframe1259").height($("#iframe1259").contents().find("body").height()+showittryitheight);
});
$("#iframe1259").height($("#iframe1259").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1259.focus();
editor1259.setSize(null, "250");
$("#rendering1259").hide();
$("#rendered1259").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 editor1259 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1259"), {
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);
}
}
});
editor1259.on("change",function(doc){
if(!binded1259){
$(window).bind('beforeunload',function(){
binded1259 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1259 = newCode;
$("textarea#stepcodeTextarea1259").val(newCode);
if(alreadyWriteCode1259!=code1259){
lastModifedTime1259 = new Date().getTime();
$("#rendering1259").show();
$("#rendered1259").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1259 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1259.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1259").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show1260"].document.write(decodeHtml($("textarea#stepcodeTextarea1260").val()));
window.frames["iframe_show1260"].document.close();
$(window.frames["iframe_show1260"]).load(function(){
$("#iframe_show1260").height($("#iframe_show1260").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1260").height($("#iframe_show1260").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>
<p class="bg-info">请输入姓名</p>
<!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>
<p class="bg-info">请输入姓名</p>
");
window.frames["iframe1260"].document.write(decodeHtml(code1260));
window.frames["iframe1260"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1260"]).load(function(){
$("#iframe1260").height($("#iframe1260").contents().find("body").height()+showittryitheight);
});
$("#iframe1260").height($("#iframe1260").contents().find("body").height()+showittryitheight);
alreadyWriteCode1260 = code1260;
$("#rendering1260").hide();
$("#rendered1260").show();
}
var tRereshRetry2DemoPanel1260 = setInterval(rereshRetry2DemoPanel1260,1000);
var binded1260 = false;
$("textarea#stepcodeTextarea1260").keyup(function(){
if(!binded1260){
$(window).bind('beforeunload',function(){
binded1260 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1260 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1260!=newCode){
// window.frames["iframe1260"].document.write("
");
// window.frames["iframe1260"].document.write(decodeHtml($("textarea#stepcodeTextarea1260").val()));
// window.frames["iframe1260"].document.close();
// $(window.frames["iframe1260"]).load(function(){
// $("#iframe1260").height($("#iframe1260").contents().find("body").height()+showittryitheight);
// });
// code1260 = newCode;
// }
});
$(".tryButton1260").click(function(){
$("#tryDiv1260").show();
$("#stepcodeTextarea1260").focus();
$("#stepcodeTextarea1260").height(200);
$("#iframe1260").height(0);
window.frames["iframe1260"].document.write("
");
window.frames["iframe1260"].document.write(decodeHtml($("textarea#stepcodeTextarea1260").val()));
window.frames["iframe1260"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1260"]).load(function(){
$("#iframe1260").height($("#iframe1260").contents().find("body").height()+showittryitheight);
});
$("#iframe1260").height($("#iframe1260").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1260.focus();
editor1260.setSize(null, "250");
$("#rendering1260").hide();
$("#rendered1260").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 editor1260 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1260"), {
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);
}
}
});
editor1260.on("change",function(doc){
if(!binded1260){
$(window).bind('beforeunload',function(){
binded1260 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1260 = newCode;
$("textarea#stepcodeTextarea1260").val(newCode);
if(alreadyWriteCode1260!=code1260){
lastModifedTime1260 = new Date().getTime();
$("#rendering1260").show();
$("#rendered1260").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1260 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1260.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1260").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show1261"].document.write(decodeHtml($("textarea#stepcodeTextarea1261").val()));
window.frames["iframe_show1261"].document.close();
$(window.frames["iframe_show1261"]).load(function(){
$("#iframe_show1261").height($("#iframe_show1261").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1261").height($("#iframe_show1261").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>
<p class="bg-warning">警告语</p>
<!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>
<p class="bg-warning">警告语</p>
");
window.frames["iframe1261"].document.write(decodeHtml(code1261));
window.frames["iframe1261"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1261"]).load(function(){
$("#iframe1261").height($("#iframe1261").contents().find("body").height()+showittryitheight);
});
$("#iframe1261").height($("#iframe1261").contents().find("body").height()+showittryitheight);
alreadyWriteCode1261 = code1261;
$("#rendering1261").hide();
$("#rendered1261").show();
}
var tRereshRetry2DemoPanel1261 = setInterval(rereshRetry2DemoPanel1261,1000);
var binded1261 = false;
$("textarea#stepcodeTextarea1261").keyup(function(){
if(!binded1261){
$(window).bind('beforeunload',function(){
binded1261 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1261 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1261!=newCode){
// window.frames["iframe1261"].document.write("
");
// window.frames["iframe1261"].document.write(decodeHtml($("textarea#stepcodeTextarea1261").val()));
// window.frames["iframe1261"].document.close();
// $(window.frames["iframe1261"]).load(function(){
// $("#iframe1261").height($("#iframe1261").contents().find("body").height()+showittryitheight);
// });
// code1261 = newCode;
// }
});
$(".tryButton1261").click(function(){
$("#tryDiv1261").show();
$("#stepcodeTextarea1261").focus();
$("#stepcodeTextarea1261").height(200);
$("#iframe1261").height(0);
window.frames["iframe1261"].document.write("
");
window.frames["iframe1261"].document.write(decodeHtml($("textarea#stepcodeTextarea1261").val()));
window.frames["iframe1261"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1261"]).load(function(){
$("#iframe1261").height($("#iframe1261").contents().find("body").height()+showittryitheight);
});
$("#iframe1261").height($("#iframe1261").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1261.focus();
editor1261.setSize(null, "250");
$("#rendering1261").hide();
$("#rendered1261").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 editor1261 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1261"), {
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);
}
}
});
editor1261.on("change",function(doc){
if(!binded1261){
$(window).bind('beforeunload',function(){
binded1261 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1261 = newCode;
$("textarea#stepcodeTextarea1261").val(newCode);
if(alreadyWriteCode1261!=code1261){
lastModifedTime1261 = new Date().getTime();
$("#rendering1261").show();
$("#rendered1261").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1261 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1261.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1261").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show1262"].document.write(decodeHtml($("textarea#stepcodeTextarea1262").val()));
window.frames["iframe_show1262"].document.close();
$(window.frames["iframe_show1262"]).load(function(){
$("#iframe_show1262").height($("#iframe_show1262").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1262").height($("#iframe_show1262").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>
<p class="bg-danger">本操作会导致服务器挂掉</p>
<!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>
<p class="bg-danger">本操作会导致服务器挂掉</p>
");
window.frames["iframe1262"].document.write(decodeHtml(code1262));
window.frames["iframe1262"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1262"]).load(function(){
$("#iframe1262").height($("#iframe1262").contents().find("body").height()+showittryitheight);
});
$("#iframe1262").height($("#iframe1262").contents().find("body").height()+showittryitheight);
alreadyWriteCode1262 = code1262;
$("#rendering1262").hide();
$("#rendered1262").show();
}
var tRereshRetry2DemoPanel1262 = setInterval(rereshRetry2DemoPanel1262,1000);
var binded1262 = false;
$("textarea#stepcodeTextarea1262").keyup(function(){
if(!binded1262){
$(window).bind('beforeunload',function(){
binded1262 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1262 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1262!=newCode){
// window.frames["iframe1262"].document.write("
");
// window.frames["iframe1262"].document.write(decodeHtml($("textarea#stepcodeTextarea1262").val()));
// window.frames["iframe1262"].document.close();
// $(window.frames["iframe1262"]).load(function(){
// $("#iframe1262").height($("#iframe1262").contents().find("body").height()+showittryitheight);
// });
// code1262 = newCode;
// }
});
$(".tryButton1262").click(function(){
$("#tryDiv1262").show();
$("#stepcodeTextarea1262").focus();
$("#stepcodeTextarea1262").height(200);
$("#iframe1262").height(0);
window.frames["iframe1262"].document.write("
");
window.frames["iframe1262"].document.write(decodeHtml($("textarea#stepcodeTextarea1262").val()));
window.frames["iframe1262"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1262"]).load(function(){
$("#iframe1262").height($("#iframe1262").contents().find("body").height()+showittryitheight);
});
$("#iframe1262").height($("#iframe1262").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1262.focus();
editor1262.setSize(null, "250");
$("#rendering1262").hide();
$("#rendered1262").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 editor1262 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1262"), {
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);
}
}
});
editor1262.on("change",function(doc){
if(!binded1262){
$(window).bind('beforeunload',function(){
binded1262 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1262 = newCode;
$("textarea#stepcodeTextarea1262").val(newCode);
if(alreadyWriteCode1262!=code1262){
lastModifedTime1262 = new Date().getTime();
$("#rendering1262").show();
$("#rendered1262").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1262 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1262.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1262").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|