|
");
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
:
非Bootstrap工具提示
示例
2
:
左侧提示
示例
3
:
右侧提示
示例
4
:
上方提示
示例
5
:
下方提示
示例
1
:
非Bootstrap工具提示
顶
折
");
window.frames["iframe_show3010"].document.write(decodeHtml($("textarea#stepcodeTextarea3010").val()));
window.frames["iframe_show3010"].document.close();
$(window.frames["iframe_show3010"]).load(function(){
$("#iframe_show3010").height($("#iframe_show3010").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3010").height($("#iframe_show3010").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>
<button class="btn btn-default" title="提示信息">非Bootstrap工具提示</button>
<!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>
<button class="btn btn-default" title="提示信息">非Bootstrap工具提示</button>
");
window.frames["iframe3010"].document.write(decodeHtml(code3010));
window.frames["iframe3010"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3010"]).load(function(){
$("#iframe3010").height($("#iframe3010").contents().find("body").height()+showittryitheight);
});
$("#iframe3010").height($("#iframe3010").contents().find("body").height()+showittryitheight);
alreadyWriteCode3010 = code3010;
$("#rendering3010").hide();
$("#rendered3010").show();
}
var tRereshRetry2DemoPanel3010 = setInterval(rereshRetry2DemoPanel3010,1000);
var binded3010 = false;
$("textarea#stepcodeTextarea3010").keyup(function(){
if(!binded3010){
$(window).bind('beforeunload',function(){
binded3010 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3010 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3010!=newCode){
// window.frames["iframe3010"].document.write("
");
// window.frames["iframe3010"].document.write(decodeHtml($("textarea#stepcodeTextarea3010").val()));
// window.frames["iframe3010"].document.close();
// $(window.frames["iframe3010"]).load(function(){
// $("#iframe3010").height($("#iframe3010").contents().find("body").height()+showittryitheight);
// });
// code3010 = newCode;
// }
});
$(".tryButton3010").click(function(){
$("#tryDiv3010").show();
$("#stepcodeTextarea3010").focus();
$("#stepcodeTextarea3010").height(200);
$("#iframe3010").height(0);
window.frames["iframe3010"].document.write("
");
window.frames["iframe3010"].document.write(decodeHtml($("textarea#stepcodeTextarea3010").val()));
window.frames["iframe3010"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3010"]).load(function(){
$("#iframe3010").height($("#iframe3010").contents().find("body").height()+showittryitheight);
});
$("#iframe3010").height($("#iframe3010").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3010.focus();
editor3010.setSize(null, "250");
$("#rendering3010").hide();
$("#rendered3010").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 editor3010 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3010"), {
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);
}
}
});
editor3010.on("change",function(doc){
if(!binded3010){
$(window).bind('beforeunload',function(){
binded3010 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3010 = newCode;
$("textarea#stepcodeTextarea3010").val(newCode);
if(alreadyWriteCode3010!=code3010){
lastModifedTime3010 = new Date().getTime();
$("#rendering3010").show();
$("#rendered3010").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3010 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3010.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3010").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show3011"].document.write(decodeHtml($("textarea#stepcodeTextarea3011").val()));
window.frames["iframe_show3011"].document.close();
$(window.frames["iframe_show3011"]).load(function(){
$("#iframe_show3011").height($("#iframe_show3011").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3011").height($("#iframe_show3011").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>
<button style="margin-left:100px" type="button" class="btn btn-default" data-toggle="tooltip" data-placement="left" title="提示信息">鼠标悬停</button>
<script>
$(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
<!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>
<button style="margin-left:100px" type="button" class="btn btn-default" data-toggle="tooltip" data-placement="left" title="提示信息">鼠标悬停</button>
<script>
$(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
");
window.frames["iframe3011"].document.write(decodeHtml(code3011));
window.frames["iframe3011"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3011"]).load(function(){
$("#iframe3011").height($("#iframe3011").contents().find("body").height()+showittryitheight);
});
$("#iframe3011").height($("#iframe3011").contents().find("body").height()+showittryitheight);
alreadyWriteCode3011 = code3011;
$("#rendering3011").hide();
$("#rendered3011").show();
}
var tRereshRetry2DemoPanel3011 = setInterval(rereshRetry2DemoPanel3011,1000);
var binded3011 = false;
$("textarea#stepcodeTextarea3011").keyup(function(){
if(!binded3011){
$(window).bind('beforeunload',function(){
binded3011 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3011 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3011!=newCode){
// window.frames["iframe3011"].document.write("
");
// window.frames["iframe3011"].document.write(decodeHtml($("textarea#stepcodeTextarea3011").val()));
// window.frames["iframe3011"].document.close();
// $(window.frames["iframe3011"]).load(function(){
// $("#iframe3011").height($("#iframe3011").contents().find("body").height()+showittryitheight);
// });
// code3011 = newCode;
// }
});
$(".tryButton3011").click(function(){
$("#tryDiv3011").show();
$("#stepcodeTextarea3011").focus();
$("#stepcodeTextarea3011").height(200);
$("#iframe3011").height(0);
window.frames["iframe3011"].document.write("
");
window.frames["iframe3011"].document.write(decodeHtml($("textarea#stepcodeTextarea3011").val()));
window.frames["iframe3011"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3011"]).load(function(){
$("#iframe3011").height($("#iframe3011").contents().find("body").height()+showittryitheight);
});
$("#iframe3011").height($("#iframe3011").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3011.focus();
editor3011.setSize(null, "250");
$("#rendering3011").hide();
$("#rendered3011").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 editor3011 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3011"), {
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);
}
}
});
editor3011.on("change",function(doc){
if(!binded3011){
$(window).bind('beforeunload',function(){
binded3011 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3011 = newCode;
$("textarea#stepcodeTextarea3011").val(newCode);
if(alreadyWriteCode3011!=code3011){
lastModifedTime3011 = new Date().getTime();
$("#rendering3011").show();
$("#rendered3011").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3011 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3011.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3011").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show3012"].document.write(decodeHtml($("textarea#stepcodeTextarea3012").val()));
window.frames["iframe_show3012"].document.close();
$(window.frames["iframe_show3012"]).load(function(){
$("#iframe_show3012").height($("#iframe_show3012").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3012").height($("#iframe_show3012").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>
<button style="margin-right:100px" type="button" class="btn btn-default" data-toggle="tooltip" data-placement="right" title="提示信息">鼠标悬停</button>
<script>
$(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
<!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>
<button style="margin-right:100px" type="button" class="btn btn-default" data-toggle="tooltip" data-placement="right" title="提示信息">鼠标悬停</button>
<script>
$(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
");
window.frames["iframe3012"].document.write(decodeHtml(code3012));
window.frames["iframe3012"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3012"]).load(function(){
$("#iframe3012").height($("#iframe3012").contents().find("body").height()+showittryitheight);
});
$("#iframe3012").height($("#iframe3012").contents().find("body").height()+showittryitheight);
alreadyWriteCode3012 = code3012;
$("#rendering3012").hide();
$("#rendered3012").show();
}
var tRereshRetry2DemoPanel3012 = setInterval(rereshRetry2DemoPanel3012,1000);
var binded3012 = false;
$("textarea#stepcodeTextarea3012").keyup(function(){
if(!binded3012){
$(window).bind('beforeunload',function(){
binded3012 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3012 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3012!=newCode){
// window.frames["iframe3012"].document.write("
");
// window.frames["iframe3012"].document.write(decodeHtml($("textarea#stepcodeTextarea3012").val()));
// window.frames["iframe3012"].document.close();
// $(window.frames["iframe3012"]).load(function(){
// $("#iframe3012").height($("#iframe3012").contents().find("body").height()+showittryitheight);
// });
// code3012 = newCode;
// }
});
$(".tryButton3012").click(function(){
$("#tryDiv3012").show();
$("#stepcodeTextarea3012").focus();
$("#stepcodeTextarea3012").height(200);
$("#iframe3012").height(0);
window.frames["iframe3012"].document.write("
");
window.frames["iframe3012"].document.write(decodeHtml($("textarea#stepcodeTextarea3012").val()));
window.frames["iframe3012"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3012"]).load(function(){
$("#iframe3012").height($("#iframe3012").contents().find("body").height()+showittryitheight);
});
$("#iframe3012").height($("#iframe3012").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3012.focus();
editor3012.setSize(null, "250");
$("#rendering3012").hide();
$("#rendered3012").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 editor3012 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3012"), {
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);
}
}
});
editor3012.on("change",function(doc){
if(!binded3012){
$(window).bind('beforeunload',function(){
binded3012 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3012 = newCode;
$("textarea#stepcodeTextarea3012").val(newCode);
if(alreadyWriteCode3012!=code3012){
lastModifedTime3012 = new Date().getTime();
$("#rendering3012").show();
$("#rendered3012").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3012 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3012.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3012").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show3013"].document.write(decodeHtml($("textarea#stepcodeTextarea3013").val()));
window.frames["iframe_show3013"].document.close();
$(window.frames["iframe_show3013"]).load(function(){
$("#iframe_show3013").height($("#iframe_show3013").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3013").height($("#iframe_show3013").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>
<button style="margin-top:50px" type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="提示信息">鼠标悬停</button>
<script>
$(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
<!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>
<button style="margin-top:50px" type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="提示信息">鼠标悬停</button>
<script>
$(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
");
window.frames["iframe3013"].document.write(decodeHtml(code3013));
window.frames["iframe3013"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3013"]).load(function(){
$("#iframe3013").height($("#iframe3013").contents().find("body").height()+showittryitheight);
});
$("#iframe3013").height($("#iframe3013").contents().find("body").height()+showittryitheight);
alreadyWriteCode3013 = code3013;
$("#rendering3013").hide();
$("#rendered3013").show();
}
var tRereshRetry2DemoPanel3013 = setInterval(rereshRetry2DemoPanel3013,1000);
var binded3013 = false;
$("textarea#stepcodeTextarea3013").keyup(function(){
if(!binded3013){
$(window).bind('beforeunload',function(){
binded3013 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3013 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3013!=newCode){
// window.frames["iframe3013"].document.write("
");
// window.frames["iframe3013"].document.write(decodeHtml($("textarea#stepcodeTextarea3013").val()));
// window.frames["iframe3013"].document.close();
// $(window.frames["iframe3013"]).load(function(){
// $("#iframe3013").height($("#iframe3013").contents().find("body").height()+showittryitheight);
// });
// code3013 = newCode;
// }
});
$(".tryButton3013").click(function(){
$("#tryDiv3013").show();
$("#stepcodeTextarea3013").focus();
$("#stepcodeTextarea3013").height(200);
$("#iframe3013").height(0);
window.frames["iframe3013"].document.write("
");
window.frames["iframe3013"].document.write(decodeHtml($("textarea#stepcodeTextarea3013").val()));
window.frames["iframe3013"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3013"]).load(function(){
$("#iframe3013").height($("#iframe3013").contents().find("body").height()+showittryitheight);
});
$("#iframe3013").height($("#iframe3013").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3013.focus();
editor3013.setSize(null, "250");
$("#rendering3013").hide();
$("#rendered3013").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 editor3013 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3013"), {
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);
}
}
});
editor3013.on("change",function(doc){
if(!binded3013){
$(window).bind('beforeunload',function(){
binded3013 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3013 = newCode;
$("textarea#stepcodeTextarea3013").val(newCode);
if(alreadyWriteCode3013!=code3013){
lastModifedTime3013 = new Date().getTime();
$("#rendering3013").show();
$("#rendered3013").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3013 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3013.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3013").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show3014"].document.write(decodeHtml($("textarea#stepcodeTextarea3014").val()));
window.frames["iframe_show3014"].document.close();
$(window.frames["iframe_show3014"]).load(function(){
$("#iframe_show3014").height($("#iframe_show3014").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3014").height($("#iframe_show3014").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>
<button style="margin-bottom:50px" type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="提示信息">鼠标悬停</button>
<script>
$(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
<!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>
<button style="margin-bottom:50px" type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="提示信息">鼠标悬停</button>
<script>
$(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
");
window.frames["iframe3014"].document.write(decodeHtml(code3014));
window.frames["iframe3014"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3014"]).load(function(){
$("#iframe3014").height($("#iframe3014").contents().find("body").height()+showittryitheight);
});
$("#iframe3014").height($("#iframe3014").contents().find("body").height()+showittryitheight);
alreadyWriteCode3014 = code3014;
$("#rendering3014").hide();
$("#rendered3014").show();
}
var tRereshRetry2DemoPanel3014 = setInterval(rereshRetry2DemoPanel3014,1000);
var binded3014 = false;
$("textarea#stepcodeTextarea3014").keyup(function(){
if(!binded3014){
$(window).bind('beforeunload',function(){
binded3014 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3014 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3014!=newCode){
// window.frames["iframe3014"].document.write("
");
// window.frames["iframe3014"].document.write(decodeHtml($("textarea#stepcodeTextarea3014").val()));
// window.frames["iframe3014"].document.close();
// $(window.frames["iframe3014"]).load(function(){
// $("#iframe3014").height($("#iframe3014").contents().find("body").height()+showittryitheight);
// });
// code3014 = newCode;
// }
});
$(".tryButton3014").click(function(){
$("#tryDiv3014").show();
$("#stepcodeTextarea3014").focus();
$("#stepcodeTextarea3014").height(200);
$("#iframe3014").height(0);
window.frames["iframe3014"].document.write("
");
window.frames["iframe3014"].document.write(decodeHtml($("textarea#stepcodeTextarea3014").val()));
window.frames["iframe3014"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3014"]).load(function(){
$("#iframe3014").height($("#iframe3014").contents().find("body").height()+showittryitheight);
});
$("#iframe3014").height($("#iframe3014").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3014.focus();
editor3014.setSize(null, "250");
$("#rendering3014").hide();
$("#rendered3014").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 editor3014 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3014"), {
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);
}
}
});
editor3014.on("change",function(doc){
if(!binded3014){
$(window).bind('beforeunload',function(){
binded3014 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3014 = newCode;
$("textarea#stepcodeTextarea3014").val(newCode);
if(alreadyWriteCode3014!=code3014){
lastModifedTime3014 = new Date().getTime();
$("#rendering3014").show();
$("#rendered3014").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3014 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3014.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3014").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|