|
");
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>
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle " data-toggle="dropdown">
default
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle " data-toggle="dropdown">
primary
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-success dropdown-toggle " data-toggle="dropdown">
success
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-info dropdown-toggle " data-toggle="dropdown">
info
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-warning dropdown-toggle " data-toggle="dropdown">
warning
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-danger dropdown-toggle " data-toggle="dropdown">
danger
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></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.0.3/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="btn-group">
<button type="button" class="btn btn-default">默认</button>
<button type="button" class="btn btn-default dropdown-toggle"
data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></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="btn-group">
<button type="button" class="btn btn-lg btn-default dropdown-toggle " data-toggle="dropdown">
大号
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn btn-default dropdown-toggle " data-toggle="dropdown">
默认
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-sm btn-default dropdown-toggle " data-toggle="dropdown">
小号
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-xs btn-default dropdown-toggle " data-toggle="dropdown">
更小
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></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 style="height:150px"></div>
<div class="btn-group dropup">
<button type="button" class="btn btn-default dropdown-toggle " id="dropdownMenu1" data-toggle="dropdown">
default
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
|
向上弹出式菜单
|
示例代码
|
示例
1
:
单按钮下拉菜单
示例
2
:
分裂式按钮下拉菜单
示例
3
:
按钮大小
示例
4
:
向上弹出式菜单
");
window.frames["iframe_show1549"].document.write(decodeHtml($("textarea#stepcodeTextarea1549").val()));
window.frames["iframe_show1549"].document.close();
$(window.frames["iframe_show1549"]).load(function(){
$("#iframe_show1549").height($("#iframe_show1549").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1549").height($("#iframe_show1549").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="btn-group">
<button type="button" class="btn btn-default dropdown-toggle " data-toggle="dropdown">
default
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle " data-toggle="dropdown">
primary
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-success dropdown-toggle " data-toggle="dropdown">
success
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-info dropdown-toggle " data-toggle="dropdown">
info
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-warning dropdown-toggle " data-toggle="dropdown">
warning
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-danger dropdown-toggle " data-toggle="dropdown">
danger
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></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="btn-group">
<button type="button" class="btn btn-default dropdown-toggle " data-toggle="dropdown">
default
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle " data-toggle="dropdown">
primary
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-success dropdown-toggle " data-toggle="dropdown">
success
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-info dropdown-toggle " data-toggle="dropdown">
info
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-warning dropdown-toggle " data-toggle="dropdown">
warning
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-danger dropdown-toggle " data-toggle="dropdown">
danger
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></div>
");
window.frames["iframe1549"].document.write(decodeHtml(code1549));
window.frames["iframe1549"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1549"]).load(function(){
$("#iframe1549").height($("#iframe1549").contents().find("body").height()+showittryitheight);
});
$("#iframe1549").height($("#iframe1549").contents().find("body").height()+showittryitheight);
alreadyWriteCode1549 = code1549;
$("#rendering1549").hide();
$("#rendered1549").show();
}
var tRereshRetry2DemoPanel1549 = setInterval(rereshRetry2DemoPanel1549,1000);
var binded1549 = false;
$("textarea#stepcodeTextarea1549").keyup(function(){
if(!binded1549){
$(window).bind('beforeunload',function(){
binded1549 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1549 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1549!=newCode){
// window.frames["iframe1549"].document.write("
");
// window.frames["iframe1549"].document.write(decodeHtml($("textarea#stepcodeTextarea1549").val()));
// window.frames["iframe1549"].document.close();
// $(window.frames["iframe1549"]).load(function(){
// $("#iframe1549").height($("#iframe1549").contents().find("body").height()+showittryitheight);
// });
// code1549 = newCode;
// }
});
$(".tryButton1549").click(function(){
$("#tryDiv1549").show();
$("#stepcodeTextarea1549").focus();
$("#stepcodeTextarea1549").height(200);
$("#iframe1549").height(0);
window.frames["iframe1549"].document.write("
");
window.frames["iframe1549"].document.write(decodeHtml($("textarea#stepcodeTextarea1549").val()));
window.frames["iframe1549"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1549"]).load(function(){
$("#iframe1549").height($("#iframe1549").contents().find("body").height()+showittryitheight);
});
$("#iframe1549").height($("#iframe1549").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1549.focus();
editor1549.setSize(null, "250");
$("#rendering1549").hide();
$("#rendered1549").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 editor1549 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1549"), {
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);
}
}
});
editor1549.on("change",function(doc){
if(!binded1549){
$(window).bind('beforeunload',function(){
binded1549 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1549 = newCode;
$("textarea#stepcodeTextarea1549").val(newCode);
if(alreadyWriteCode1549!=code1549){
lastModifedTime1549 = new Date().getTime();
$("#rendering1549").show();
$("#rendered1549").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1549 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1549.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1549").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show1550"].document.write(decodeHtml($("textarea#stepcodeTextarea1550").val()));
window.frames["iframe_show1550"].document.close();
$(window.frames["iframe_show1550"]).load(function(){
$("#iframe_show1550").height($("#iframe_show1550").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1550").height($("#iframe_show1550").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.0.3/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="btn-group">
<button type="button" class="btn btn-default">默认</button>
<button type="button" class="btn btn-default dropdown-toggle"
data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></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.0.3/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="btn-group">
<button type="button" class="btn btn-default">默认</button>
<button type="button" class="btn btn-default dropdown-toggle"
data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></div>
");
window.frames["iframe1550"].document.write(decodeHtml(code1550));
window.frames["iframe1550"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1550"]).load(function(){
$("#iframe1550").height($("#iframe1550").contents().find("body").height()+showittryitheight);
});
$("#iframe1550").height($("#iframe1550").contents().find("body").height()+showittryitheight);
alreadyWriteCode1550 = code1550;
$("#rendering1550").hide();
$("#rendered1550").show();
}
var tRereshRetry2DemoPanel1550 = setInterval(rereshRetry2DemoPanel1550,1000);
var binded1550 = false;
$("textarea#stepcodeTextarea1550").keyup(function(){
if(!binded1550){
$(window).bind('beforeunload',function(){
binded1550 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1550 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1550!=newCode){
// window.frames["iframe1550"].document.write("
");
// window.frames["iframe1550"].document.write(decodeHtml($("textarea#stepcodeTextarea1550").val()));
// window.frames["iframe1550"].document.close();
// $(window.frames["iframe1550"]).load(function(){
// $("#iframe1550").height($("#iframe1550").contents().find("body").height()+showittryitheight);
// });
// code1550 = newCode;
// }
});
$(".tryButton1550").click(function(){
$("#tryDiv1550").show();
$("#stepcodeTextarea1550").focus();
$("#stepcodeTextarea1550").height(200);
$("#iframe1550").height(0);
window.frames["iframe1550"].document.write("
");
window.frames["iframe1550"].document.write(decodeHtml($("textarea#stepcodeTextarea1550").val()));
window.frames["iframe1550"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1550"]).load(function(){
$("#iframe1550").height($("#iframe1550").contents().find("body").height()+showittryitheight);
});
$("#iframe1550").height($("#iframe1550").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1550.focus();
editor1550.setSize(null, "250");
$("#rendering1550").hide();
$("#rendered1550").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 editor1550 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1550"), {
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);
}
}
});
editor1550.on("change",function(doc){
if(!binded1550){
$(window).bind('beforeunload',function(){
binded1550 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1550 = newCode;
$("textarea#stepcodeTextarea1550").val(newCode);
if(alreadyWriteCode1550!=code1550){
lastModifedTime1550 = new Date().getTime();
$("#rendering1550").show();
$("#rendered1550").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1550 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1550.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1550").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show1551"].document.write(decodeHtml($("textarea#stepcodeTextarea1551").val()));
window.frames["iframe_show1551"].document.close();
$(window.frames["iframe_show1551"]).load(function(){
$("#iframe_show1551").height($("#iframe_show1551").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1551").height($("#iframe_show1551").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="btn-group">
<button type="button" class="btn btn-lg btn-default dropdown-toggle " data-toggle="dropdown">
大号
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn btn-default dropdown-toggle " data-toggle="dropdown">
默认
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-sm btn-default dropdown-toggle " data-toggle="dropdown">
小号
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-xs btn-default dropdown-toggle " data-toggle="dropdown">
更小
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></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="btn-group">
<button type="button" class="btn btn-lg btn-default dropdown-toggle " data-toggle="dropdown">
大号
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn btn-default dropdown-toggle " data-toggle="dropdown">
默认
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-sm btn-default dropdown-toggle " data-toggle="dropdown">
小号
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-xs btn-default dropdown-toggle " data-toggle="dropdown">
更小
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
<div style="height:100px"></div>
");
window.frames["iframe1551"].document.write(decodeHtml(code1551));
window.frames["iframe1551"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1551"]).load(function(){
$("#iframe1551").height($("#iframe1551").contents().find("body").height()+showittryitheight);
});
$("#iframe1551").height($("#iframe1551").contents().find("body").height()+showittryitheight);
alreadyWriteCode1551 = code1551;
$("#rendering1551").hide();
$("#rendered1551").show();
}
var tRereshRetry2DemoPanel1551 = setInterval(rereshRetry2DemoPanel1551,1000);
var binded1551 = false;
$("textarea#stepcodeTextarea1551").keyup(function(){
if(!binded1551){
$(window).bind('beforeunload',function(){
binded1551 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1551 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1551!=newCode){
// window.frames["iframe1551"].document.write("
");
// window.frames["iframe1551"].document.write(decodeHtml($("textarea#stepcodeTextarea1551").val()));
// window.frames["iframe1551"].document.close();
// $(window.frames["iframe1551"]).load(function(){
// $("#iframe1551").height($("#iframe1551").contents().find("body").height()+showittryitheight);
// });
// code1551 = newCode;
// }
});
$(".tryButton1551").click(function(){
$("#tryDiv1551").show();
$("#stepcodeTextarea1551").focus();
$("#stepcodeTextarea1551").height(200);
$("#iframe1551").height(0);
window.frames["iframe1551"].document.write("
");
window.frames["iframe1551"].document.write(decodeHtml($("textarea#stepcodeTextarea1551").val()));
window.frames["iframe1551"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1551"]).load(function(){
$("#iframe1551").height($("#iframe1551").contents().find("body").height()+showittryitheight);
});
$("#iframe1551").height($("#iframe1551").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1551.focus();
editor1551.setSize(null, "250");
$("#rendering1551").hide();
$("#rendered1551").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 editor1551 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1551"), {
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);
}
}
});
editor1551.on("change",function(doc){
if(!binded1551){
$(window).bind('beforeunload',function(){
binded1551 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1551 = newCode;
$("textarea#stepcodeTextarea1551").val(newCode);
if(alreadyWriteCode1551!=code1551){
lastModifedTime1551 = new Date().getTime();
$("#rendering1551").show();
$("#rendered1551").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1551 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1551.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1551").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show1552"].document.write(decodeHtml($("textarea#stepcodeTextarea1552").val()));
window.frames["iframe_show1552"].document.close();
$(window.frames["iframe_show1552"]).load(function(){
$("#iframe_show1552").height($("#iframe_show1552").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1552").height($("#iframe_show1552").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:150px"></div>
<div class="btn-group dropup">
<button type="button" class="btn btn-default dropdown-toggle " id="dropdownMenu1" data-toggle="dropdown">
default
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</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 style="height:150px"></div>
<div class="btn-group dropup">
<button type="button" class="btn btn-default dropdown-toggle " id="dropdownMenu1" data-toggle="dropdown">
default
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li>
<a href="#">HTML</a>
</li>
<li role="presentation">
<a href="#">CSS</a>
</li>
<li role="presentation">
<a href="#">Javascript</a>
</li>
<li role="presentation">
<a href="#">AJAX</a>
</li>
</ul>
</div>
");
window.frames["iframe1552"].document.write(decodeHtml(code1552));
window.frames["iframe1552"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1552"]).load(function(){
$("#iframe1552").height($("#iframe1552").contents().find("body").height()+showittryitheight);
});
$("#iframe1552").height($("#iframe1552").contents().find("body").height()+showittryitheight);
alreadyWriteCode1552 = code1552;
$("#rendering1552").hide();
$("#rendered1552").show();
}
var tRereshRetry2DemoPanel1552 = setInterval(rereshRetry2DemoPanel1552,1000);
var binded1552 = false;
$("textarea#stepcodeTextarea1552").keyup(function(){
if(!binded1552){
$(window).bind('beforeunload',function(){
binded1552 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1552 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1552!=newCode){
// window.frames["iframe1552"].document.write("
");
// window.frames["iframe1552"].document.write(decodeHtml($("textarea#stepcodeTextarea1552").val()));
// window.frames["iframe1552"].document.close();
// $(window.frames["iframe1552"]).load(function(){
// $("#iframe1552").height($("#iframe1552").contents().find("body").height()+showittryitheight);
// });
// code1552 = newCode;
// }
});
$(".tryButton1552").click(function(){
$("#tryDiv1552").show();
$("#stepcodeTextarea1552").focus();
$("#stepcodeTextarea1552").height(200);
$("#iframe1552").height(0);
window.frames["iframe1552"].document.write("
");
window.frames["iframe1552"].document.write(decodeHtml($("textarea#stepcodeTextarea1552").val()));
window.frames["iframe1552"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1552"]).load(function(){
$("#iframe1552").height($("#iframe1552").contents().find("body").height()+showittryitheight);
});
$("#iframe1552").height($("#iframe1552").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1552.focus();
editor1552.setSize(null, "250");
$("#rendering1552").hide();
$("#rendered1552").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 editor1552 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1552"), {
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);
}
}
});
editor1552.on("change",function(doc){
if(!binded1552){
$(window).bind('beforeunload',function(){
binded1552 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1552 = newCode;
$("textarea#stepcodeTextarea1552").val(newCode);
if(alreadyWriteCode1552!=code1552){
lastModifedTime1552 = new Date().getTime();
$("#rendering1552").show();
$("#rendered1552").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1552 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1552.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1552").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|