|
");
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
:
警告标签
示例
6
:
危险标签
");
window.frames["iframe_show2969"].document.write(decodeHtml($("textarea#stepcodeTextarea2969").val()));
window.frames["iframe_show2969"].document.close();
$(window.frames["iframe_show2969"]).load(function(){
$("#iframe_show2969").height($("#iframe_show2969").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2969").height($("#iframe_show2969").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 style="height:10px"></div>
<span class="label label-default">默认</span>
<!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 style="height:10px"></div>
<span class="label label-default">默认</span>
");
window.frames["iframe2969"].document.write(decodeHtml(code2969));
window.frames["iframe2969"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2969"]).load(function(){
$("#iframe2969").height($("#iframe2969").contents().find("body").height()+showittryitheight);
});
$("#iframe2969").height($("#iframe2969").contents().find("body").height()+showittryitheight);
alreadyWriteCode2969 = code2969;
$("#rendering2969").hide();
$("#rendered2969").show();
}
var tRereshRetry2DemoPanel2969 = setInterval(rereshRetry2DemoPanel2969,1000);
var binded2969 = false;
$("textarea#stepcodeTextarea2969").keyup(function(){
if(!binded2969){
$(window).bind('beforeunload',function(){
binded2969 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2969 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2969!=newCode){
// window.frames["iframe2969"].document.write("
");
// window.frames["iframe2969"].document.write(decodeHtml($("textarea#stepcodeTextarea2969").val()));
// window.frames["iframe2969"].document.close();
// $(window.frames["iframe2969"]).load(function(){
// $("#iframe2969").height($("#iframe2969").contents().find("body").height()+showittryitheight);
// });
// code2969 = newCode;
// }
});
$(".tryButton2969").click(function(){
$("#tryDiv2969").show();
$("#stepcodeTextarea2969").focus();
$("#stepcodeTextarea2969").height(200);
$("#iframe2969").height(0);
window.frames["iframe2969"].document.write("
");
window.frames["iframe2969"].document.write(decodeHtml($("textarea#stepcodeTextarea2969").val()));
window.frames["iframe2969"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2969"]).load(function(){
$("#iframe2969").height($("#iframe2969").contents().find("body").height()+showittryitheight);
});
$("#iframe2969").height($("#iframe2969").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2969.focus();
editor2969.setSize(null, "250");
$("#rendering2969").hide();
$("#rendered2969").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 editor2969 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2969"), {
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);
}
}
});
editor2969.on("change",function(doc){
if(!binded2969){
$(window).bind('beforeunload',function(){
binded2969 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2969 = newCode;
$("textarea#stepcodeTextarea2969").val(newCode);
if(alreadyWriteCode2969!=code2969){
lastModifedTime2969 = new Date().getTime();
$("#rendering2969").show();
$("#rendered2969").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2969 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2969.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2969").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2970"].document.write(decodeHtml($("textarea#stepcodeTextarea2970").val()));
window.frames["iframe_show2970"].document.close();
$(window.frames["iframe_show2970"]).load(function(){
$("#iframe_show2970").height($("#iframe_show2970").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2970").height($("#iframe_show2970").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<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 style="height:10px"></div>
<span class="label label-primary">强调</span>
<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 style="height:10px"></div>
<span class="label label-primary">强调</span>
");
window.frames["iframe2970"].document.write(decodeHtml(code2970));
window.frames["iframe2970"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2970"]).load(function(){
$("#iframe2970").height($("#iframe2970").contents().find("body").height()+showittryitheight);
});
$("#iframe2970").height($("#iframe2970").contents().find("body").height()+showittryitheight);
alreadyWriteCode2970 = code2970;
$("#rendering2970").hide();
$("#rendered2970").show();
}
var tRereshRetry2DemoPanel2970 = setInterval(rereshRetry2DemoPanel2970,1000);
var binded2970 = false;
$("textarea#stepcodeTextarea2970").keyup(function(){
if(!binded2970){
$(window).bind('beforeunload',function(){
binded2970 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2970 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2970!=newCode){
// window.frames["iframe2970"].document.write("
");
// window.frames["iframe2970"].document.write(decodeHtml($("textarea#stepcodeTextarea2970").val()));
// window.frames["iframe2970"].document.close();
// $(window.frames["iframe2970"]).load(function(){
// $("#iframe2970").height($("#iframe2970").contents().find("body").height()+showittryitheight);
// });
// code2970 = newCode;
// }
});
$(".tryButton2970").click(function(){
$("#tryDiv2970").show();
$("#stepcodeTextarea2970").focus();
$("#stepcodeTextarea2970").height(200);
$("#iframe2970").height(0);
window.frames["iframe2970"].document.write("
");
window.frames["iframe2970"].document.write(decodeHtml($("textarea#stepcodeTextarea2970").val()));
window.frames["iframe2970"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2970"]).load(function(){
$("#iframe2970").height($("#iframe2970").contents().find("body").height()+showittryitheight);
});
$("#iframe2970").height($("#iframe2970").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2970.focus();
editor2970.setSize(null, "250");
$("#rendering2970").hide();
$("#rendered2970").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 editor2970 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2970"), {
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);
}
}
});
editor2970.on("change",function(doc){
if(!binded2970){
$(window).bind('beforeunload',function(){
binded2970 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2970 = newCode;
$("textarea#stepcodeTextarea2970").val(newCode);
if(alreadyWriteCode2970!=code2970){
lastModifedTime2970 = new Date().getTime();
$("#rendering2970").show();
$("#rendered2970").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2970 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2970.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2970").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2971"].document.write(decodeHtml($("textarea#stepcodeTextarea2971").val()));
window.frames["iframe_show2971"].document.close();
$(window.frames["iframe_show2971"]).load(function(){
$("#iframe_show2971").height($("#iframe_show2971").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2971").height($("#iframe_show2971").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<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 style="height:10px"></div>
<span class="label label-success">成功</span>
<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 style="height:10px"></div>
<span class="label label-success">成功</span>
");
window.frames["iframe2971"].document.write(decodeHtml(code2971));
window.frames["iframe2971"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2971"]).load(function(){
$("#iframe2971").height($("#iframe2971").contents().find("body").height()+showittryitheight);
});
$("#iframe2971").height($("#iframe2971").contents().find("body").height()+showittryitheight);
alreadyWriteCode2971 = code2971;
$("#rendering2971").hide();
$("#rendered2971").show();
}
var tRereshRetry2DemoPanel2971 = setInterval(rereshRetry2DemoPanel2971,1000);
var binded2971 = false;
$("textarea#stepcodeTextarea2971").keyup(function(){
if(!binded2971){
$(window).bind('beforeunload',function(){
binded2971 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2971 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2971!=newCode){
// window.frames["iframe2971"].document.write("
");
// window.frames["iframe2971"].document.write(decodeHtml($("textarea#stepcodeTextarea2971").val()));
// window.frames["iframe2971"].document.close();
// $(window.frames["iframe2971"]).load(function(){
// $("#iframe2971").height($("#iframe2971").contents().find("body").height()+showittryitheight);
// });
// code2971 = newCode;
// }
});
$(".tryButton2971").click(function(){
$("#tryDiv2971").show();
$("#stepcodeTextarea2971").focus();
$("#stepcodeTextarea2971").height(200);
$("#iframe2971").height(0);
window.frames["iframe2971"].document.write("
");
window.frames["iframe2971"].document.write(decodeHtml($("textarea#stepcodeTextarea2971").val()));
window.frames["iframe2971"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2971"]).load(function(){
$("#iframe2971").height($("#iframe2971").contents().find("body").height()+showittryitheight);
});
$("#iframe2971").height($("#iframe2971").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2971.focus();
editor2971.setSize(null, "250");
$("#rendering2971").hide();
$("#rendered2971").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 editor2971 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2971"), {
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);
}
}
});
editor2971.on("change",function(doc){
if(!binded2971){
$(window).bind('beforeunload',function(){
binded2971 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2971 = newCode;
$("textarea#stepcodeTextarea2971").val(newCode);
if(alreadyWriteCode2971!=code2971){
lastModifedTime2971 = new Date().getTime();
$("#rendering2971").show();
$("#rendered2971").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2971 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2971.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2971").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2972"].document.write(decodeHtml($("textarea#stepcodeTextarea2972").val()));
window.frames["iframe_show2972"].document.close();
$(window.frames["iframe_show2972"]).load(function(){
$("#iframe_show2972").height($("#iframe_show2972").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2972").height($("#iframe_show2972").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<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 style="height:10px"></div>
<span class="label label-info">信息</span>
<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 style="height:10px"></div>
<span class="label label-info">信息</span>
");
window.frames["iframe2972"].document.write(decodeHtml(code2972));
window.frames["iframe2972"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2972"]).load(function(){
$("#iframe2972").height($("#iframe2972").contents().find("body").height()+showittryitheight);
});
$("#iframe2972").height($("#iframe2972").contents().find("body").height()+showittryitheight);
alreadyWriteCode2972 = code2972;
$("#rendering2972").hide();
$("#rendered2972").show();
}
var tRereshRetry2DemoPanel2972 = setInterval(rereshRetry2DemoPanel2972,1000);
var binded2972 = false;
$("textarea#stepcodeTextarea2972").keyup(function(){
if(!binded2972){
$(window).bind('beforeunload',function(){
binded2972 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2972 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2972!=newCode){
// window.frames["iframe2972"].document.write("
");
// window.frames["iframe2972"].document.write(decodeHtml($("textarea#stepcodeTextarea2972").val()));
// window.frames["iframe2972"].document.close();
// $(window.frames["iframe2972"]).load(function(){
// $("#iframe2972").height($("#iframe2972").contents().find("body").height()+showittryitheight);
// });
// code2972 = newCode;
// }
});
$(".tryButton2972").click(function(){
$("#tryDiv2972").show();
$("#stepcodeTextarea2972").focus();
$("#stepcodeTextarea2972").height(200);
$("#iframe2972").height(0);
window.frames["iframe2972"].document.write("
");
window.frames["iframe2972"].document.write(decodeHtml($("textarea#stepcodeTextarea2972").val()));
window.frames["iframe2972"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2972"]).load(function(){
$("#iframe2972").height($("#iframe2972").contents().find("body").height()+showittryitheight);
});
$("#iframe2972").height($("#iframe2972").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2972.focus();
editor2972.setSize(null, "250");
$("#rendering2972").hide();
$("#rendered2972").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 editor2972 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2972"), {
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);
}
}
});
editor2972.on("change",function(doc){
if(!binded2972){
$(window).bind('beforeunload',function(){
binded2972 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2972 = newCode;
$("textarea#stepcodeTextarea2972").val(newCode);
if(alreadyWriteCode2972!=code2972){
lastModifedTime2972 = new Date().getTime();
$("#rendering2972").show();
$("#rendered2972").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2972 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2972.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2972").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2973"].document.write(decodeHtml($("textarea#stepcodeTextarea2973").val()));
window.frames["iframe_show2973"].document.close();
$(window.frames["iframe_show2973"]).load(function(){
$("#iframe_show2973").height($("#iframe_show2973").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2973").height($("#iframe_show2973").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<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 style="height:10px"></div>
<span class="label label-warning">警告</span>
<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 style="height:10px"></div>
<span class="label label-warning">警告</span>
");
window.frames["iframe2973"].document.write(decodeHtml(code2973));
window.frames["iframe2973"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2973"]).load(function(){
$("#iframe2973").height($("#iframe2973").contents().find("body").height()+showittryitheight);
});
$("#iframe2973").height($("#iframe2973").contents().find("body").height()+showittryitheight);
alreadyWriteCode2973 = code2973;
$("#rendering2973").hide();
$("#rendered2973").show();
}
var tRereshRetry2DemoPanel2973 = setInterval(rereshRetry2DemoPanel2973,1000);
var binded2973 = false;
$("textarea#stepcodeTextarea2973").keyup(function(){
if(!binded2973){
$(window).bind('beforeunload',function(){
binded2973 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2973 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2973!=newCode){
// window.frames["iframe2973"].document.write("
");
// window.frames["iframe2973"].document.write(decodeHtml($("textarea#stepcodeTextarea2973").val()));
// window.frames["iframe2973"].document.close();
// $(window.frames["iframe2973"]).load(function(){
// $("#iframe2973").height($("#iframe2973").contents().find("body").height()+showittryitheight);
// });
// code2973 = newCode;
// }
});
$(".tryButton2973").click(function(){
$("#tryDiv2973").show();
$("#stepcodeTextarea2973").focus();
$("#stepcodeTextarea2973").height(200);
$("#iframe2973").height(0);
window.frames["iframe2973"].document.write("
");
window.frames["iframe2973"].document.write(decodeHtml($("textarea#stepcodeTextarea2973").val()));
window.frames["iframe2973"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2973"]).load(function(){
$("#iframe2973").height($("#iframe2973").contents().find("body").height()+showittryitheight);
});
$("#iframe2973").height($("#iframe2973").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2973.focus();
editor2973.setSize(null, "250");
$("#rendering2973").hide();
$("#rendered2973").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 editor2973 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2973"), {
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);
}
}
});
editor2973.on("change",function(doc){
if(!binded2973){
$(window).bind('beforeunload',function(){
binded2973 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2973 = newCode;
$("textarea#stepcodeTextarea2973").val(newCode);
if(alreadyWriteCode2973!=code2973){
lastModifedTime2973 = new Date().getTime();
$("#rendering2973").show();
$("#rendered2973").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2973 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2973.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2973").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show2974"].document.write(decodeHtml($("textarea#stepcodeTextarea2974").val()));
window.frames["iframe_show2974"].document.close();
$(window.frames["iframe_show2974"]).load(function(){
$("#iframe_show2974").height($("#iframe_show2974").contents().find("body").height()+showittryitheight);
});
$("#iframe_show2974").height($("#iframe_show2974").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<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 style="height:10px"></div>
<span class="label label-danger">危险</span>
<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 style="height:10px"></div>
<span class="label label-danger">危险</span>
");
window.frames["iframe2974"].document.write(decodeHtml(code2974));
window.frames["iframe2974"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2974"]).load(function(){
$("#iframe2974").height($("#iframe2974").contents().find("body").height()+showittryitheight);
});
$("#iframe2974").height($("#iframe2974").contents().find("body").height()+showittryitheight);
alreadyWriteCode2974 = code2974;
$("#rendering2974").hide();
$("#rendered2974").show();
}
var tRereshRetry2DemoPanel2974 = setInterval(rereshRetry2DemoPanel2974,1000);
var binded2974 = false;
$("textarea#stepcodeTextarea2974").keyup(function(){
if(!binded2974){
$(window).bind('beforeunload',function(){
binded2974 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code2974 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code2974!=newCode){
// window.frames["iframe2974"].document.write("
");
// window.frames["iframe2974"].document.write(decodeHtml($("textarea#stepcodeTextarea2974").val()));
// window.frames["iframe2974"].document.close();
// $(window.frames["iframe2974"]).load(function(){
// $("#iframe2974").height($("#iframe2974").contents().find("body").height()+showittryitheight);
// });
// code2974 = newCode;
// }
});
$(".tryButton2974").click(function(){
$("#tryDiv2974").show();
$("#stepcodeTextarea2974").focus();
$("#stepcodeTextarea2974").height(200);
$("#iframe2974").height(0);
window.frames["iframe2974"].document.write("
");
window.frames["iframe2974"].document.write(decodeHtml($("textarea#stepcodeTextarea2974").val()));
window.frames["iframe2974"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe2974"]).load(function(){
$("#iframe2974").height($("#iframe2974").contents().find("body").height()+showittryitheight);
});
$("#iframe2974").height($("#iframe2974").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor2974.focus();
editor2974.setSize(null, "250");
$("#rendering2974").hide();
$("#rendered2974").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 editor2974 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2974"), {
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);
}
}
});
editor2974.on("change",function(doc){
if(!binded2974){
$(window).bind('beforeunload',function(){
binded2974 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code2974 = newCode;
$("textarea#stepcodeTextarea2974").val(newCode);
if(alreadyWriteCode2974!=code2974){
lastModifedTime2974 = new Date().getTime();
$("#rendering2974").show();
$("#rendered2974").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor2974 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor2974.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv2974").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|