how2j.cn

"); 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>
<ul class="list-group">
  <li class="list-group-item">回锅肉</li>
  <li class="list-group-item">烧烤</li>
  <li class="list-group-item">鱼香肉丝</li>
  <li class="list-group-item">麻婆豆腐</li>
  <li class="list-group-item">夫妻肺片</li>
</ul>
基本列表组
示例代码
<!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>
<ul class="list-group">
  <li class="list-group-item"><span class="badge">3</span>回锅肉</li>
  <li class="list-group-item"><span class="badge">14</span>烧烤</li>
  <li class="list-group-item"><span class="badge">15</span>鱼香肉丝</li>
  <li class="list-group-item"><span class="badge">92</span>麻婆豆腐</li>
  <li class="list-group-item"><span class="badge">6</span>夫妻肺片</li>
</ul>
徽记
示例代码
<!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="list-group">
  <a href="#" class="list-group-item active">
    回锅肉
  </a>
  <a href="#" class="list-group-item">烧烤</a>
  <a href="#" class="list-group-item">鱼香肉丝</a>
  <a href="#" class="list-group-item">麻婆豆腐</a>
  <a href="#" class="list-group-item">夫妻肺片</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>
<div class="list-group">
  <button type="button" class="list-group-item active">
    回锅肉
  </button>
  <button type="button" class="list-group-item">烧烤</button>
  <button type="button" class="list-group-item">鱼香肉丝</button>
  <button type="button" class="list-group-item">麻婆豆腐</button>
  <button type="button" class="list-group-item">夫妻肺片</button>
</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="list-group">
  <a href="#" class="list-group-item active">
    回锅肉
  </a>
  <a href="#" class="list-group-item list-group-item-success">烧烤</a>
  <a href="#" class="list-group-item list-group-item-info">鱼香肉丝</a>
  <a href="#" class="list-group-item list-group-item-warning">麻婆豆腐</a>
  <a href="#" class="list-group-item list-group-item-danger">夫妻肺片</a>
</div>
颜色
示例代码
示例 1 : 基本列表组   
示例 2 : 徽记   
示例 3 : 链接   
示例 4 : 按钮   
示例 5 : 颜色   

示例 1 :

基本列表组

基本列表组
"); window.frames["iframe_show2990"].document.write(decodeHtml($("textarea#stepcodeTextarea2990").val())); window.frames["iframe_show2990"].document.close(); $(window.frames["iframe_show2990"]).load(function(){ $("#iframe_show2990").height($("#iframe_show2990").contents().find("body").height()+showittryitheight); }); $("#iframe_show2990").height($("#iframe_show2990").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> <ul class="list-group"> <li class="list-group-item">回锅肉</li> <li class="list-group-item">烧烤</li> <li class="list-group-item">鱼香肉丝</li> <li class="list-group-item">麻婆豆腐</li> <li class="list-group-item">夫妻肺片</li> </ul>
<!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>
<ul class="list-group">
  <li class="list-group-item">回锅肉</li>
  <li class="list-group-item">烧烤</li>
  <li class="list-group-item">鱼香肉丝</li>
  <li class="list-group-item">麻婆豆腐</li>
  <li class="list-group-item">夫妻肺片</li>
</ul>
"); window.frames["iframe2990"].document.write(decodeHtml(code2990)); window.frames["iframe2990"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2990"]).load(function(){ $("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight); }); $("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight); alreadyWriteCode2990 = code2990; $("#rendering2990").hide(); $("#rendered2990").show(); } var tRereshRetry2DemoPanel2990 = setInterval(rereshRetry2DemoPanel2990,1000); var binded2990 = false; $("textarea#stepcodeTextarea2990").keyup(function(){ if(!binded2990){ $(window).bind('beforeunload',function(){ binded2990 = true; return "xxxx"; }); } var newCode = $(this).val() code2990 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code2990!=newCode){ // window.frames["iframe2990"].document.write("
"); // window.frames["iframe2990"].document.write(decodeHtml($("textarea#stepcodeTextarea2990").val())); // window.frames["iframe2990"].document.close(); // $(window.frames["iframe2990"]).load(function(){ // $("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight); // }); // code2990 = newCode; // } }); $(".tryButton2990").click(function(){ $("#tryDiv2990").show(); $("#stepcodeTextarea2990").focus(); $("#stepcodeTextarea2990").height(200); $("#iframe2990").height(0); window.frames["iframe2990"].document.write("
"); window.frames["iframe2990"].document.write(decodeHtml($("textarea#stepcodeTextarea2990").val())); window.frames["iframe2990"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2990"]).load(function(){ $("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight); }); $("#iframe2990").height($("#iframe2990").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor2990.focus(); editor2990.setSize(null, "250"); $("#rendering2990").hide(); $("#rendered2990").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 editor2990 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2990"), { 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); } } }); editor2990.on("change",function(doc){ if(!binded2990){ $(window).bind('beforeunload',function(){ binded2990 = true; return "xxxx"; }); } var newCode = doc.getValue(); code2990 = newCode; $("textarea#stepcodeTextarea2990").val(newCode); if(alreadyWriteCode2990!=code2990){ lastModifedTime2990 = new Date().getTime(); $("#rendering2990").show(); $("#rendered2990").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor2990 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor2990.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv2990").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 2 :

徽记

徽记
"); window.frames["iframe_show2991"].document.write(decodeHtml($("textarea#stepcodeTextarea2991").val())); window.frames["iframe_show2991"].document.close(); $(window.frames["iframe_show2991"]).load(function(){ $("#iframe_show2991").height($("#iframe_show2991").contents().find("body").height()+showittryitheight); }); $("#iframe_show2991").height($("#iframe_show2991").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> <ul class="list-group"> <li class="list-group-item"><span class="badge">3</span>回锅肉</li> <li class="list-group-item"><span class="badge">14</span>烧烤</li> <li class="list-group-item"><span class="badge">15</span>鱼香肉丝</li> <li class="list-group-item"><span class="badge">92</span>麻婆豆腐</li> <li class="list-group-item"><span class="badge">6</span>夫妻肺片</li> </ul>
<!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>
<ul class="list-group">
  <li class="list-group-item"><span class="badge">3</span>回锅肉</li>
  <li class="list-group-item"><span class="badge">14</span>烧烤</li>
  <li class="list-group-item"><span class="badge">15</span>鱼香肉丝</li>
  <li class="list-group-item"><span class="badge">92</span>麻婆豆腐</li>
  <li class="list-group-item"><span class="badge">6</span>夫妻肺片</li>
</ul>
"); window.frames["iframe2991"].document.write(decodeHtml(code2991)); window.frames["iframe2991"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2991"]).load(function(){ $("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight); }); $("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight); alreadyWriteCode2991 = code2991; $("#rendering2991").hide(); $("#rendered2991").show(); } var tRereshRetry2DemoPanel2991 = setInterval(rereshRetry2DemoPanel2991,1000); var binded2991 = false; $("textarea#stepcodeTextarea2991").keyup(function(){ if(!binded2991){ $(window).bind('beforeunload',function(){ binded2991 = true; return "xxxx"; }); } var newCode = $(this).val() code2991 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code2991!=newCode){ // window.frames["iframe2991"].document.write("
"); // window.frames["iframe2991"].document.write(decodeHtml($("textarea#stepcodeTextarea2991").val())); // window.frames["iframe2991"].document.close(); // $(window.frames["iframe2991"]).load(function(){ // $("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight); // }); // code2991 = newCode; // } }); $(".tryButton2991").click(function(){ $("#tryDiv2991").show(); $("#stepcodeTextarea2991").focus(); $("#stepcodeTextarea2991").height(200); $("#iframe2991").height(0); window.frames["iframe2991"].document.write("
"); window.frames["iframe2991"].document.write(decodeHtml($("textarea#stepcodeTextarea2991").val())); window.frames["iframe2991"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2991"]).load(function(){ $("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight); }); $("#iframe2991").height($("#iframe2991").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor2991.focus(); editor2991.setSize(null, "250"); $("#rendering2991").hide(); $("#rendered2991").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 editor2991 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2991"), { 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); } } }); editor2991.on("change",function(doc){ if(!binded2991){ $(window).bind('beforeunload',function(){ binded2991 = true; return "xxxx"; }); } var newCode = doc.getValue(); code2991 = newCode; $("textarea#stepcodeTextarea2991").val(newCode); if(alreadyWriteCode2991!=code2991){ lastModifedTime2991 = new Date().getTime(); $("#rendering2991").show(); $("#rendered2991").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor2991 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor2991.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv2991").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 3 :

链接

链接
"); window.frames["iframe_show2992"].document.write(decodeHtml($("textarea#stepcodeTextarea2992").val())); window.frames["iframe_show2992"].document.close(); $(window.frames["iframe_show2992"]).load(function(){ $("#iframe_show2992").height($("#iframe_show2992").contents().find("body").height()+showittryitheight); }); $("#iframe_show2992").height($("#iframe_show2992").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="list-group"> <a href="#" class="list-group-item active"> 回锅肉 </a> <a href="#" class="list-group-item">烧烤</a> <a href="#" class="list-group-item">鱼香肉丝</a> <a href="#" class="list-group-item">麻婆豆腐</a> <a href="#" class="list-group-item">夫妻肺片</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>
<div class="list-group">
  <a href="#" class="list-group-item active">
    回锅肉
  </a>
  <a href="#" class="list-group-item">烧烤</a>
  <a href="#" class="list-group-item">鱼香肉丝</a>
  <a href="#" class="list-group-item">麻婆豆腐</a>
  <a href="#" class="list-group-item">夫妻肺片</a>
</div>
"); window.frames["iframe2992"].document.write(decodeHtml(code2992)); window.frames["iframe2992"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2992"]).load(function(){ $("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight); }); $("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight); alreadyWriteCode2992 = code2992; $("#rendering2992").hide(); $("#rendered2992").show(); } var tRereshRetry2DemoPanel2992 = setInterval(rereshRetry2DemoPanel2992,1000); var binded2992 = false; $("textarea#stepcodeTextarea2992").keyup(function(){ if(!binded2992){ $(window).bind('beforeunload',function(){ binded2992 = true; return "xxxx"; }); } var newCode = $(this).val() code2992 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code2992!=newCode){ // window.frames["iframe2992"].document.write("
"); // window.frames["iframe2992"].document.write(decodeHtml($("textarea#stepcodeTextarea2992").val())); // window.frames["iframe2992"].document.close(); // $(window.frames["iframe2992"]).load(function(){ // $("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight); // }); // code2992 = newCode; // } }); $(".tryButton2992").click(function(){ $("#tryDiv2992").show(); $("#stepcodeTextarea2992").focus(); $("#stepcodeTextarea2992").height(200); $("#iframe2992").height(0); window.frames["iframe2992"].document.write("
"); window.frames["iframe2992"].document.write(decodeHtml($("textarea#stepcodeTextarea2992").val())); window.frames["iframe2992"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2992"]).load(function(){ $("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight); }); $("#iframe2992").height($("#iframe2992").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor2992.focus(); editor2992.setSize(null, "250"); $("#rendering2992").hide(); $("#rendered2992").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 editor2992 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2992"), { 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); } } }); editor2992.on("change",function(doc){ if(!binded2992){ $(window).bind('beforeunload',function(){ binded2992 = true; return "xxxx"; }); } var newCode = doc.getValue(); code2992 = newCode; $("textarea#stepcodeTextarea2992").val(newCode); if(alreadyWriteCode2992!=code2992){ lastModifedTime2992 = new Date().getTime(); $("#rendering2992").show(); $("#rendered2992").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor2992 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor2992.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv2992").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 4 :

按钮

按钮
"); window.frames["iframe_show2993"].document.write(decodeHtml($("textarea#stepcodeTextarea2993").val())); window.frames["iframe_show2993"].document.close(); $(window.frames["iframe_show2993"]).load(function(){ $("#iframe_show2993").height($("#iframe_show2993").contents().find("body").height()+showittryitheight); }); $("#iframe_show2993").height($("#iframe_show2993").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="list-group"> <button type="button" class="list-group-item active"> 回锅肉 </button> <button type="button" class="list-group-item">烧烤</button> <button type="button" class="list-group-item">鱼香肉丝</button> <button type="button" class="list-group-item">麻婆豆腐</button> <button type="button" class="list-group-item">夫妻肺片</button> </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="list-group">
  <button type="button" class="list-group-item active">
    回锅肉
  </button>
  <button type="button" class="list-group-item">烧烤</button>
  <button type="button" class="list-group-item">鱼香肉丝</button>
  <button type="button" class="list-group-item">麻婆豆腐</button>
  <button type="button" class="list-group-item">夫妻肺片</button>
</div>
"); window.frames["iframe2993"].document.write(decodeHtml(code2993)); window.frames["iframe2993"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2993"]).load(function(){ $("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight); }); $("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight); alreadyWriteCode2993 = code2993; $("#rendering2993").hide(); $("#rendered2993").show(); } var tRereshRetry2DemoPanel2993 = setInterval(rereshRetry2DemoPanel2993,1000); var binded2993 = false; $("textarea#stepcodeTextarea2993").keyup(function(){ if(!binded2993){ $(window).bind('beforeunload',function(){ binded2993 = true; return "xxxx"; }); } var newCode = $(this).val() code2993 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code2993!=newCode){ // window.frames["iframe2993"].document.write("
"); // window.frames["iframe2993"].document.write(decodeHtml($("textarea#stepcodeTextarea2993").val())); // window.frames["iframe2993"].document.close(); // $(window.frames["iframe2993"]).load(function(){ // $("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight); // }); // code2993 = newCode; // } }); $(".tryButton2993").click(function(){ $("#tryDiv2993").show(); $("#stepcodeTextarea2993").focus(); $("#stepcodeTextarea2993").height(200); $("#iframe2993").height(0); window.frames["iframe2993"].document.write("
"); window.frames["iframe2993"].document.write(decodeHtml($("textarea#stepcodeTextarea2993").val())); window.frames["iframe2993"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2993"]).load(function(){ $("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight); }); $("#iframe2993").height($("#iframe2993").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor2993.focus(); editor2993.setSize(null, "250"); $("#rendering2993").hide(); $("#rendered2993").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 editor2993 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2993"), { 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); } } }); editor2993.on("change",function(doc){ if(!binded2993){ $(window).bind('beforeunload',function(){ binded2993 = true; return "xxxx"; }); } var newCode = doc.getValue(); code2993 = newCode; $("textarea#stepcodeTextarea2993").val(newCode); if(alreadyWriteCode2993!=code2993){ lastModifedTime2993 = new Date().getTime(); $("#rendering2993").show(); $("#rendered2993").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor2993 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor2993.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv2993").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 5 :

颜色

颜色
"); window.frames["iframe_show2994"].document.write(decodeHtml($("textarea#stepcodeTextarea2994").val())); window.frames["iframe_show2994"].document.close(); $(window.frames["iframe_show2994"]).load(function(){ $("#iframe_show2994").height($("#iframe_show2994").contents().find("body").height()+showittryitheight); }); $("#iframe_show2994").height($("#iframe_show2994").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="list-group"> <a href="#" class="list-group-item active"> 回锅肉 </a> <a href="#" class="list-group-item list-group-item-success">烧烤</a> <a href="#" class="list-group-item list-group-item-info">鱼香肉丝</a> <a href="#" class="list-group-item list-group-item-warning">麻婆豆腐</a> <a href="#" class="list-group-item list-group-item-danger">夫妻肺片</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>
<div class="list-group">
  <a href="#" class="list-group-item active">
    回锅肉
  </a>
  <a href="#" class="list-group-item list-group-item-success">烧烤</a>
  <a href="#" class="list-group-item list-group-item-info">鱼香肉丝</a>
  <a href="#" class="list-group-item list-group-item-warning">麻婆豆腐</a>
  <a href="#" class="list-group-item list-group-item-danger">夫妻肺片</a>
</div>
"); window.frames["iframe2994"].document.write(decodeHtml(code2994)); window.frames["iframe2994"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2994"]).load(function(){ $("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight); }); $("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight); alreadyWriteCode2994 = code2994; $("#rendering2994").hide(); $("#rendered2994").show(); } var tRereshRetry2DemoPanel2994 = setInterval(rereshRetry2DemoPanel2994,1000); var binded2994 = false; $("textarea#stepcodeTextarea2994").keyup(function(){ if(!binded2994){ $(window).bind('beforeunload',function(){ binded2994 = true; return "xxxx"; }); } var newCode = $(this).val() code2994 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code2994!=newCode){ // window.frames["iframe2994"].document.write("
"); // window.frames["iframe2994"].document.write(decodeHtml($("textarea#stepcodeTextarea2994").val())); // window.frames["iframe2994"].document.close(); // $(window.frames["iframe2994"]).load(function(){ // $("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight); // }); // code2994 = newCode; // } }); $(".tryButton2994").click(function(){ $("#tryDiv2994").show(); $("#stepcodeTextarea2994").focus(); $("#stepcodeTextarea2994").height(200); $("#iframe2994").height(0); window.frames["iframe2994"].document.write("
"); window.frames["iframe2994"].document.write(decodeHtml($("textarea#stepcodeTextarea2994").val())); window.frames["iframe2994"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe2994"]).load(function(){ $("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight); }); $("#iframe2994").height($("#iframe2994").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor2994.focus(); editor2994.setSize(null, "250"); $("#rendering2994").hide(); $("#rendered2994").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 editor2994 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea2994"), { 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); } } }); editor2994.on("change",function(doc){ if(!binded2994){ $(window).bind('beforeunload',function(){ binded2994 = true; return "xxxx"; }); } var newCode = doc.getValue(); code2994 = newCode; $("textarea#stepcodeTextarea2994").val(newCode); if(alreadyWriteCode2994!=code2994){ lastModifedTime2994 = new Date().getTime(); $("#rendering2994").show(); $("#rendered2994").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor2994 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor2994.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv2994").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果


HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。


关于 前端部分-BootStrap-列表组 的提问

尽量提供截图代码异常信息,有助于分析和解决问题。 也可进本站QQ群交流: 620943819
提问尽量提供完整的代码,环境描述,越是有利于问题的重现,您的问题越能更快得到解答。
对教程中代码有疑问,请提供是哪个步骤,哪一行有疑问,这样便于快速定位问题,提高问题得到解答的速度
在已经存在的几千个提问里,有相当大的比例,是因为使用了和站长不同版本的开发环境导致的,比如 jdk, eclpise, idea, mysql,tomcat 等等软件的版本不一致。
请使用和站长一样的版本,可以节约自己大量的学习时间。 站长把教学中用的软件版本整理了,都统一放在了这里, 方便大家下载: http://how2j.cn/k/helloworld/helloworld-version/1718.html

上传截图