how2j.cn


工具版本兼容问题
浮动的框可以向左或向右移动,直到它的外边缘碰到包含框或另一个浮动框的边框为止。

属性:float
值: left,right

示例 1 : 文字向右浮动   
示例 2 : 文字向左浮动   
示例 3 : 文字围绕图片   
示例 4 : 文字不想围绕图片   
示例 5 : 水平排列div   

示例 1 :

文字向右浮动

文字向右浮动
浮动后,原来的“”就让出来了
并且是在原来的高度的基础上,向右浮动
"); window.frames["iframe_show488"].document.write(decodeHtml($("textarea#stepcodeTextarea488").val())); window.frames["iframe_show488"].document.close(); $(window.frames["iframe_show488"]).load(function(){ $("#iframe_show488").height($("#iframe_show488").contents().find("body").height()+showittryitheight); }); $("#iframe_show488").height($("#iframe_show488").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<style> .f{ float:right; } </style> <div >正常文字1</div> <div >正常文字2</div> <div class="f">浮动的文字</div> <div >正常文字4</div> <div >正常文字5</div>
<style>
.f{
  float:right;
}

</style>

<div >正常文字1</div>
<div >正常文字2</div>
<div class="f">浮动的文字</div>
<div >正常文字4</div>
<div >正常文字5</div>
"); window.frames["iframe488"].document.write(decodeHtml(code488)); window.frames["iframe488"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe488"]).load(function(){ $("#iframe488").height($("#iframe488").contents().find("body").height()+showittryitheight); }); $("#iframe488").height($("#iframe488").contents().find("body").height()+showittryitheight); alreadyWriteCode488 = code488; $("#rendering488").hide(); $("#rendered488").show(); } var tRereshRetry2DemoPanel488 = setInterval(rereshRetry2DemoPanel488,1000); var binded488 = false; $("textarea#stepcodeTextarea488").keyup(function(){ if(!binded488){ $(window).bind('beforeunload',function(){ binded488 = true; return "xxxx"; }); } var newCode = $(this).val() code488 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code488!=newCode){ // window.frames["iframe488"].document.write("
"); // window.frames["iframe488"].document.write(decodeHtml($("textarea#stepcodeTextarea488").val())); // window.frames["iframe488"].document.close(); // $(window.frames["iframe488"]).load(function(){ // $("#iframe488").height($("#iframe488").contents().find("body").height()+showittryitheight); // }); // code488 = newCode; // } }); $(".tryButton488").click(function(){ $("#tryDiv488").show(); $("#stepcodeTextarea488").focus(); $("#stepcodeTextarea488").height(200); $("#iframe488").height(0); window.frames["iframe488"].document.write("
"); window.frames["iframe488"].document.write(decodeHtml($("textarea#stepcodeTextarea488").val())); window.frames["iframe488"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe488"]).load(function(){ $("#iframe488").height($("#iframe488").contents().find("body").height()+showittryitheight); }); $("#iframe488").height($("#iframe488").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor488.focus(); editor488.setSize(null, "250"); $("#rendering488").hide(); $("#rendered488").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 editor488 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea488"), { 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); } } }); editor488.on("change",function(doc){ if(!binded488){ $(window).bind('beforeunload',function(){ binded488 = true; return "xxxx"; }); } var newCode = doc.getValue(); code488 = newCode; $("textarea#stepcodeTextarea488").val(newCode); if(alreadyWriteCode488!=code488){ lastModifedTime488 = new Date().getTime(); $("#rendering488").show(); $("#rendered488").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor488 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor488.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv488").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


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

文字向左浮动

文字向左浮动
首先,向左浮动后,会把“坑”让出来,这个时候"正常的文字4“ 就会过来试图占这个坑,但是,发现 “浮动的文字”并没有走,结果,就只好排在它后面了
"); window.frames["iframe_show489"].document.write(decodeHtml($("textarea#stepcodeTextarea489").val())); window.frames["iframe_show489"].document.close(); $(window.frames["iframe_show489"]).load(function(){ $("#iframe_show489").height($("#iframe_show489").contents().find("body").height()+showittryitheight); }); $("#iframe_show489").height($("#iframe_show489").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<style> .f{ float:left; } </style> <div >正常文字1</div> <div >正常文字2</div> <div class="f">浮动的文字</div> <div >正常文字4</div> <div >正常文字5</div>
<style>
.f{
  float:left;
}

</style>

<div >正常文字1</div>
<div >正常文字2</div>
<div class="f">浮动的文字</div>
<div >正常文字4</div>
<div >正常文字5</div>
"); window.frames["iframe489"].document.write(decodeHtml(code489)); window.frames["iframe489"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe489"]).load(function(){ $("#iframe489").height($("#iframe489").contents().find("body").height()+showittryitheight); }); $("#iframe489").height($("#iframe489").contents().find("body").height()+showittryitheight); alreadyWriteCode489 = code489; $("#rendering489").hide(); $("#rendered489").show(); } var tRereshRetry2DemoPanel489 = setInterval(rereshRetry2DemoPanel489,1000); var binded489 = false; $("textarea#stepcodeTextarea489").keyup(function(){ if(!binded489){ $(window).bind('beforeunload',function(){ binded489 = true; return "xxxx"; }); } var newCode = $(this).val() code489 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code489!=newCode){ // window.frames["iframe489"].document.write("
"); // window.frames["iframe489"].document.write(decodeHtml($("textarea#stepcodeTextarea489").val())); // window.frames["iframe489"].document.close(); // $(window.frames["iframe489"]).load(function(){ // $("#iframe489").height($("#iframe489").contents().find("body").height()+showittryitheight); // }); // code489 = newCode; // } }); $(".tryButton489").click(function(){ $("#tryDiv489").show(); $("#stepcodeTextarea489").focus(); $("#stepcodeTextarea489").height(200); $("#iframe489").height(0); window.frames["iframe489"].document.write("
"); window.frames["iframe489"].document.write(decodeHtml($("textarea#stepcodeTextarea489").val())); window.frames["iframe489"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe489"]).load(function(){ $("#iframe489").height($("#iframe489").contents().find("body").height()+showittryitheight); }); $("#iframe489").height($("#iframe489").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor489.focus(); editor489.setSize(null, "250"); $("#rendering489").hide(); $("#rendered489").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 editor489 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea489"), { 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); } } }); editor489.on("change",function(doc){ if(!binded489){ $(window).bind('beforeunload',function(){ binded489 = true; return "xxxx"; }); } var newCode = doc.getValue(); code489 = newCode; $("textarea#stepcodeTextarea489").val(newCode); if(alreadyWriteCode489!=code489){ lastModifedTime489 = new Date().getTime(); $("#rendering489").show(); $("#rendered489").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor489 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor489.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv489").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


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

文字围绕图片

当图片不浮动时,文字就会换行出现在下面
当图片浮动时,文字围绕着图片
和步骤2一样,当图片浮动的时候,就会让出这个“坑”出来,这个时候文字就试图去填补这个“坑”,结果发现,尼玛,图片没走,那就只好围绕图片摆放了
"); window.frames["iframe_show490"].document.write(decodeHtml($("textarea#stepcodeTextarea490").val())); window.frames["iframe_show490"].document.close(); $(window.frames["iframe_show490"]).load(function(){ $("#iframe_show490").height($("#iframe_show490").contents().find("body").height()+showittryitheight); }); $("#iframe_show490").height($("#iframe_show490").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<style> .f{ float:left; } div{ width:320px; } </style> <div > <img src="http://127.0.0.1/example.gif"/> <p> 当图片不浮动时,文字就会换行出现在下面 当图片不浮动时,文字就会换行出现在下面 当图片不浮动时,文字就会换行出现在下面 当图片不浮动时,文字就会换行出现在下面 当图片不浮动时,文字就会换行出现在下面 当图片不浮动时,文字就会换行出现在下面 </p> </div> <div > <img class="f" src="http://127.0.0.1/example.gif"/> <p> 当图片浮动时,文字围绕着图片 当图片浮动时,文字围绕着图片 当图片浮动时,文字围绕着图片 当图片浮动时,文字围绕着图片 当图片浮动时,文字围绕着图片 </p> </div>
"); window.frames["iframe490"].document.write(decodeHtml(code490)); window.frames["iframe490"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe490"]).load(function(){ $("#iframe490").height($("#iframe490").contents().find("body").height()+showittryitheight); }); $("#iframe490").height($("#iframe490").contents().find("body").height()+showittryitheight); alreadyWriteCode490 = code490; $("#rendering490").hide(); $("#rendered490").show(); } var tRereshRetry2DemoPanel490 = setInterval(rereshRetry2DemoPanel490,1000); var binded490 = false; $("textarea#stepcodeTextarea490").keyup(function(){ if(!binded490){ $(window).bind('beforeunload',function(){ binded490 = true; return "xxxx"; }); } var newCode = $(this).val() code490 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code490!=newCode){ // window.frames["iframe490"].document.write("
"); // window.frames["iframe490"].document.write(decodeHtml($("textarea#stepcodeTextarea490").val())); // window.frames["iframe490"].document.close(); // $(window.frames["iframe490"]).load(function(){ // $("#iframe490").height($("#iframe490").contents().find("body").height()+showittryitheight); // }); // code490 = newCode; // } }); $(".tryButton490").click(function(){ $("#tryDiv490").show(); $("#stepcodeTextarea490").focus(); $("#stepcodeTextarea490").height(200); $("#iframe490").height(0); window.frames["iframe490"].document.write("
"); window.frames["iframe490"].document.write(decodeHtml($("textarea#stepcodeTextarea490").val())); window.frames["iframe490"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe490"]).load(function(){ $("#iframe490").height($("#iframe490").contents().find("body").height()+showittryitheight); }); $("#iframe490").height($("#iframe490").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor490.focus(); editor490.setSize(null, "250"); $("#rendering490").hide(); $("#rendered490").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 editor490 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea490"), { 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); } } }); editor490.on("change",function(doc){ if(!binded490){ $(window).bind('beforeunload',function(){ binded490 = true; return "xxxx"; }); } var newCode = doc.getValue(); code490 = newCode; $("textarea#stepcodeTextarea490").val(newCode); if(alreadyWriteCode490!=code490){ lastModifedTime490 = new Date().getTime(); $("#rendering490").show(); $("#rendered490").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor490 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor490.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv490").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


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

文字不想围绕图片

不允许出现浮动元素
属性:clear
值: left right both none
如果p左边出现了浮动的元素,如此例,则设置clear:left 即达到不允许浮动元素出现在左边的效果
"); window.frames["iframe_show491"].document.write(decodeHtml($("textarea#stepcodeTextarea491").val())); window.frames["iframe_show491"].document.close(); $(window.frames["iframe_show491"]).load(function(){ $("#iframe_show491").height($("#iframe_show491").contents().find("body").height()+showittryitheight); }); $("#iframe_show491").height($("#iframe_show491").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<style> .f{ float:left; } div{ width:320px; } .clearp{ clear:left; } </style> <div > <img class="f" src="http://127.0.0.1/example.gif"/> <p> 当图片浮动时,文字围绕着图片 当图片浮动时,文字围绕着图片 当图片浮动时,文字围绕着图片 当图片浮动时,文字围绕着图片 当图片浮动时,文字围绕着图片 </p> </div> <div > <img class="f" src="http://127.0.0.1/example.gif"/> <p class="clearp"> 当图片浮动时,文字却不想围绕图片 当图片浮动时,文字却不想围绕图片 当图片浮动时,文字却不想围绕图片 当图片浮动时,文字却不想围绕图片 </p> </div>
"); window.frames["iframe491"].document.write(decodeHtml(code491)); window.frames["iframe491"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe491"]).load(function(){ $("#iframe491").height($("#iframe491").contents().find("body").height()+showittryitheight); }); $("#iframe491").height($("#iframe491").contents().find("body").height()+showittryitheight); alreadyWriteCode491 = code491; $("#rendering491").hide(); $("#rendered491").show(); } var tRereshRetry2DemoPanel491 = setInterval(rereshRetry2DemoPanel491,1000); var binded491 = false; $("textarea#stepcodeTextarea491").keyup(function(){ if(!binded491){ $(window).bind('beforeunload',function(){ binded491 = true; return "xxxx"; }); } var newCode = $(this).val() code491 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code491!=newCode){ // window.frames["iframe491"].document.write("
"); // window.frames["iframe491"].document.write(decodeHtml($("textarea#stepcodeTextarea491").val())); // window.frames["iframe491"].document.close(); // $(window.frames["iframe491"]).load(function(){ // $("#iframe491").height($("#iframe491").contents().find("body").height()+showittryitheight); // }); // code491 = newCode; // } }); $(".tryButton491").click(function(){ $("#tryDiv491").show(); $("#stepcodeTextarea491").focus(); $("#stepcodeTextarea491").height(200); $("#iframe491").height(0); window.frames["iframe491"].document.write("
"); window.frames["iframe491"].document.write(decodeHtml($("textarea#stepcodeTextarea491").val())); window.frames["iframe491"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe491"]).load(function(){ $("#iframe491").height($("#iframe491").contents().find("body").height()+showittryitheight); }); $("#iframe491").height($("#iframe491").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor491.focus(); editor491.setSize(null, "250"); $("#rendering491").hide(); $("#rendered491").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 editor491 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea491"), { 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); } } }); editor491.on("change",function(doc){ if(!binded491){ $(window).bind('beforeunload',function(){ binded491 = true; return "xxxx"; }); } var newCode = doc.getValue(); code491 = newCode; $("textarea#stepcodeTextarea491").val(newCode); if(alreadyWriteCode491!=code491){ lastModifedTime491 = new Date().getTime(); $("#rendering491").show(); $("#rendered491").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor491 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor491.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv491").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


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

水平排列div

默认的div排列是会换行的
如果使用float就可以达到水平排列的效果,通常会用在菜单,导航栏等地方
如果超出了父容器,还会有自动换行的效果
"); window.frames["iframe_show492"].document.write(decodeHtml($("textarea#stepcodeTextarea492").val())); window.frames["iframe_show492"].document.close(); $(window.frames["iframe_show492"]).load(function(){ $("#iframe_show492").height($("#iframe_show492").contents().find("body").height()+showittryitheight); }); $("#iframe_show492").height($("#iframe_show492").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<style> div#floatingDiv{ width:200px; } div#floatingDiv div{ float:left; } </style> 默认的div排列是会换行的 <div> 菜单1 </div> <div> 菜单2 </div> <div> 菜单3 </div> 如果使用float就可以达到水平排列的效果,通常会用在菜单,导航栏等地方 如果超出了父容器,还会有自动换行的效果 <div id="floatingDiv"> <div> 菜单1 </div> <div> 菜单2 </div> <div> 菜单3 </div> <div> 菜单4 </div> <div> 菜单5 </div> <div> 菜单6 </div> </div>
"); window.frames["iframe492"].document.write(decodeHtml(code492)); window.frames["iframe492"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe492"]).load(function(){ $("#iframe492").height($("#iframe492").contents().find("body").height()+showittryitheight); }); $("#iframe492").height($("#iframe492").contents().find("body").height()+showittryitheight); alreadyWriteCode492 = code492; $("#rendering492").hide(); $("#rendered492").show(); } var tRereshRetry2DemoPanel492 = setInterval(rereshRetry2DemoPanel492,1000); var binded492 = false; $("textarea#stepcodeTextarea492").keyup(function(){ if(!binded492){ $(window).bind('beforeunload',function(){ binded492 = true; return "xxxx"; }); } var newCode = $(this).val() code492 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code492!=newCode){ // window.frames["iframe492"].document.write("
"); // window.frames["iframe492"].document.write(decodeHtml($("textarea#stepcodeTextarea492").val())); // window.frames["iframe492"].document.close(); // $(window.frames["iframe492"]).load(function(){ // $("#iframe492").height($("#iframe492").contents().find("body").height()+showittryitheight); // }); // code492 = newCode; // } }); $(".tryButton492").click(function(){ $("#tryDiv492").show(); $("#stepcodeTextarea492").focus(); $("#stepcodeTextarea492").height(200); $("#iframe492").height(0); window.frames["iframe492"].document.write("
"); window.frames["iframe492"].document.write(decodeHtml($("textarea#stepcodeTextarea492").val())); window.frames["iframe492"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe492"]).load(function(){ $("#iframe492").height($("#iframe492").contents().find("body").height()+showittryitheight); }); $("#iframe492").height($("#iframe492").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor492.focus(); editor492.setSize(null, "250"); $("#rendering492").hide(); $("#rendered492").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 editor492 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea492"), { 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); } } }); editor492.on("change",function(doc){ if(!binded492){ $(window).bind('beforeunload',function(){ binded492 = true; return "xxxx"; }); } var newCode = doc.getValue(); code492 = newCode; $("textarea#stepcodeTextarea492").val(newCode); if(alreadyWriteCode492!=code492){ lastModifedTime492 = new Date().getTime(); $("#rendering492").show(); $("#rendered492").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor492 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor492.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv492").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


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


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


关于 前端部分-CSS-浮动 的提问

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

上传截图