|
");
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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
</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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
<div class="carousel-caption">
LOL1
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
<div class="carousel-caption">
LOL2
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
<div class="carousel-caption">
LOL3
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
<div class="carousel-caption">
LOL4
</div>
</div>
</div>
</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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="1000">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
</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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</a>
</div>
|
控制前后的轮播
|
示例代码
|
示例
1
:
基本轮播
示例
2
:
带标题的轮播
示例
3
:
设置轮播速度
示例
4
:
控制前后的轮播
");
window.frames["iframe_show3020"].document.write(decodeHtml($("textarea#stepcodeTextarea3020").val()));
window.frames["iframe_show3020"].document.close();
$(window.frames["iframe_show3020"]).load(function(){
$("#iframe_show3020").height($("#iframe_show3020").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3020").height($("#iframe_show3020").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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
</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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
</div>
");
window.frames["iframe3020"].document.write(decodeHtml(code3020));
window.frames["iframe3020"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3020"]).load(function(){
$("#iframe3020").height($("#iframe3020").contents().find("body").height()+showittryitheight);
});
$("#iframe3020").height($("#iframe3020").contents().find("body").height()+showittryitheight);
alreadyWriteCode3020 = code3020;
$("#rendering3020").hide();
$("#rendered3020").show();
}
var tRereshRetry2DemoPanel3020 = setInterval(rereshRetry2DemoPanel3020,1000);
var binded3020 = false;
$("textarea#stepcodeTextarea3020").keyup(function(){
if(!binded3020){
$(window).bind('beforeunload',function(){
binded3020 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3020 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3020!=newCode){
// window.frames["iframe3020"].document.write("
");
// window.frames["iframe3020"].document.write(decodeHtml($("textarea#stepcodeTextarea3020").val()));
// window.frames["iframe3020"].document.close();
// $(window.frames["iframe3020"]).load(function(){
// $("#iframe3020").height($("#iframe3020").contents().find("body").height()+showittryitheight);
// });
// code3020 = newCode;
// }
});
$(".tryButton3020").click(function(){
$("#tryDiv3020").show();
$("#stepcodeTextarea3020").focus();
$("#stepcodeTextarea3020").height(200);
$("#iframe3020").height(0);
window.frames["iframe3020"].document.write("
");
window.frames["iframe3020"].document.write(decodeHtml($("textarea#stepcodeTextarea3020").val()));
window.frames["iframe3020"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3020"]).load(function(){
$("#iframe3020").height($("#iframe3020").contents().find("body").height()+showittryitheight);
});
$("#iframe3020").height($("#iframe3020").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3020.focus();
editor3020.setSize(null, "250");
$("#rendering3020").hide();
$("#rendered3020").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 editor3020 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3020"), {
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);
}
}
});
editor3020.on("change",function(doc){
if(!binded3020){
$(window).bind('beforeunload',function(){
binded3020 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3020 = newCode;
$("textarea#stepcodeTextarea3020").val(newCode);
if(alreadyWriteCode3020!=code3020){
lastModifedTime3020 = new Date().getTime();
$("#rendering3020").show();
$("#rendered3020").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3020 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3020.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3020").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show3019"].document.write(decodeHtml($("textarea#stepcodeTextarea3019").val()));
window.frames["iframe_show3019"].document.close();
$(window.frames["iframe_show3019"]).load(function(){
$("#iframe_show3019").height($("#iframe_show3019").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3019").height($("#iframe_show3019").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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
<div class="carousel-caption">
LOL1
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
<div class="carousel-caption">
LOL2
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
<div class="carousel-caption">
LOL3
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
<div class="carousel-caption">
LOL4
</div>
</div>
</div>
</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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
<div class="carousel-caption">
LOL1
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
<div class="carousel-caption">
LOL2
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
<div class="carousel-caption">
LOL3
</div>
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
<div class="carousel-caption">
LOL4
</div>
</div>
</div>
</div>
");
window.frames["iframe3019"].document.write(decodeHtml(code3019));
window.frames["iframe3019"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3019"]).load(function(){
$("#iframe3019").height($("#iframe3019").contents().find("body").height()+showittryitheight);
});
$("#iframe3019").height($("#iframe3019").contents().find("body").height()+showittryitheight);
alreadyWriteCode3019 = code3019;
$("#rendering3019").hide();
$("#rendered3019").show();
}
var tRereshRetry2DemoPanel3019 = setInterval(rereshRetry2DemoPanel3019,1000);
var binded3019 = false;
$("textarea#stepcodeTextarea3019").keyup(function(){
if(!binded3019){
$(window).bind('beforeunload',function(){
binded3019 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3019 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3019!=newCode){
// window.frames["iframe3019"].document.write("
");
// window.frames["iframe3019"].document.write(decodeHtml($("textarea#stepcodeTextarea3019").val()));
// window.frames["iframe3019"].document.close();
// $(window.frames["iframe3019"]).load(function(){
// $("#iframe3019").height($("#iframe3019").contents().find("body").height()+showittryitheight);
// });
// code3019 = newCode;
// }
});
$(".tryButton3019").click(function(){
$("#tryDiv3019").show();
$("#stepcodeTextarea3019").focus();
$("#stepcodeTextarea3019").height(200);
$("#iframe3019").height(0);
window.frames["iframe3019"].document.write("
");
window.frames["iframe3019"].document.write(decodeHtml($("textarea#stepcodeTextarea3019").val()));
window.frames["iframe3019"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3019"]).load(function(){
$("#iframe3019").height($("#iframe3019").contents().find("body").height()+showittryitheight);
});
$("#iframe3019").height($("#iframe3019").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3019.focus();
editor3019.setSize(null, "250");
$("#rendering3019").hide();
$("#rendered3019").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 editor3019 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3019"), {
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);
}
}
});
editor3019.on("change",function(doc){
if(!binded3019){
$(window).bind('beforeunload',function(){
binded3019 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3019 = newCode;
$("textarea#stepcodeTextarea3019").val(newCode);
if(alreadyWriteCode3019!=code3019){
lastModifedTime3019 = new Date().getTime();
$("#rendering3019").show();
$("#rendered3019").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3019 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3019.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3019").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show3021"].document.write(decodeHtml($("textarea#stepcodeTextarea3021").val()));
window.frames["iframe_show3021"].document.close();
$(window.frames["iframe_show3021"]).load(function(){
$("#iframe_show3021").height($("#iframe_show3021").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3021").height($("#iframe_show3021").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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="1000">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
</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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="1000">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
</div>
");
window.frames["iframe3021"].document.write(decodeHtml(code3021));
window.frames["iframe3021"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3021"]).load(function(){
$("#iframe3021").height($("#iframe3021").contents().find("body").height()+showittryitheight);
});
$("#iframe3021").height($("#iframe3021").contents().find("body").height()+showittryitheight);
alreadyWriteCode3021 = code3021;
$("#rendering3021").hide();
$("#rendered3021").show();
}
var tRereshRetry2DemoPanel3021 = setInterval(rereshRetry2DemoPanel3021,1000);
var binded3021 = false;
$("textarea#stepcodeTextarea3021").keyup(function(){
if(!binded3021){
$(window).bind('beforeunload',function(){
binded3021 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3021 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3021!=newCode){
// window.frames["iframe3021"].document.write("
");
// window.frames["iframe3021"].document.write(decodeHtml($("textarea#stepcodeTextarea3021").val()));
// window.frames["iframe3021"].document.close();
// $(window.frames["iframe3021"]).load(function(){
// $("#iframe3021").height($("#iframe3021").contents().find("body").height()+showittryitheight);
// });
// code3021 = newCode;
// }
});
$(".tryButton3021").click(function(){
$("#tryDiv3021").show();
$("#stepcodeTextarea3021").focus();
$("#stepcodeTextarea3021").height(200);
$("#iframe3021").height(0);
window.frames["iframe3021"].document.write("
");
window.frames["iframe3021"].document.write(decodeHtml($("textarea#stepcodeTextarea3021").val()));
window.frames["iframe3021"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3021"]).load(function(){
$("#iframe3021").height($("#iframe3021").contents().find("body").height()+showittryitheight);
});
$("#iframe3021").height($("#iframe3021").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3021.focus();
editor3021.setSize(null, "250");
$("#rendering3021").hide();
$("#rendered3021").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 editor3021 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3021"), {
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);
}
}
});
editor3021.on("change",function(doc){
if(!binded3021){
$(window).bind('beforeunload',function(){
binded3021 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3021 = newCode;
$("textarea#stepcodeTextarea3021").val(newCode);
if(alreadyWriteCode3021!=code3021){
lastModifedTime3021 = new Date().getTime();
$("#rendering3021").show();
$("#rendered3021").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3021 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3021.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3021").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show3022"].document.write(decodeHtml($("textarea#stepcodeTextarea3022").val()));
window.frames["iframe_show3022"].document.close();
$(window.frames["iframe_show3022"]).load(function(){
$("#iframe_show3022").height($("#iframe_show3022").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3022").height($("#iframe_show3022").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>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</a>
</div>
<!DOCTYPE html>
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
<style>
div.item img{
width:100%;
}
div#carousel-example-generic{
width:80%;
margin:0 auto;
}
</style>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://127.0.0.1../../../img/site/step/3491.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3492.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3493.png" >
</div>
<div class="item">
<img src="http://127.0.0.1../../../img/site/step/3494.png" >
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</a>
</div>
");
window.frames["iframe3022"].document.write(decodeHtml(code3022));
window.frames["iframe3022"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3022"]).load(function(){
$("#iframe3022").height($("#iframe3022").contents().find("body").height()+showittryitheight);
});
$("#iframe3022").height($("#iframe3022").contents().find("body").height()+showittryitheight);
alreadyWriteCode3022 = code3022;
$("#rendering3022").hide();
$("#rendered3022").show();
}
var tRereshRetry2DemoPanel3022 = setInterval(rereshRetry2DemoPanel3022,1000);
var binded3022 = false;
$("textarea#stepcodeTextarea3022").keyup(function(){
if(!binded3022){
$(window).bind('beforeunload',function(){
binded3022 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3022 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3022!=newCode){
// window.frames["iframe3022"].document.write("
");
// window.frames["iframe3022"].document.write(decodeHtml($("textarea#stepcodeTextarea3022").val()));
// window.frames["iframe3022"].document.close();
// $(window.frames["iframe3022"]).load(function(){
// $("#iframe3022").height($("#iframe3022").contents().find("body").height()+showittryitheight);
// });
// code3022 = newCode;
// }
});
$(".tryButton3022").click(function(){
$("#tryDiv3022").show();
$("#stepcodeTextarea3022").focus();
$("#stepcodeTextarea3022").height(200);
$("#iframe3022").height(0);
window.frames["iframe3022"].document.write("
");
window.frames["iframe3022"].document.write(decodeHtml($("textarea#stepcodeTextarea3022").val()));
window.frames["iframe3022"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3022"]).load(function(){
$("#iframe3022").height($("#iframe3022").contents().find("body").height()+showittryitheight);
});
$("#iframe3022").height($("#iframe3022").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3022.focus();
editor3022.setSize(null, "250");
$("#rendering3022").hide();
$("#rendered3022").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 editor3022 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3022"), {
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);
}
}
});
editor3022.on("change",function(doc){
if(!binded3022){
$(window).bind('beforeunload',function(){
binded3022 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3022 = newCode;
$("textarea#stepcodeTextarea3022").val(newCode);
if(alreadyWriteCode3022!=code3022){
lastModifedTime3022 = new Date().getTime();
$("#rendering3022").show();
$("#rendered3022").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3022 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3022.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3022").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|