|
示例
1
:
斜体
示例
2
:
同时具有粗体和斜体效果
区别: i是italic的缩写,仅仅表示该文本是斜体的,并不暗示这段文字的重要性
em 是 Emphasized的缩写,虽然也是斜体,但是更多的是强调语义上的加重,提醒用户该文本的重要性。 常常用于引入新的术语的时候使用。
");
window.frames["iframe_show326"].document.write(decodeHtml($("textarea#stepcodeTextarea326").val()));
window.frames["iframe_show326"].document.close();
$(window.frames["iframe_show326"]).load(function(){
$("#iframe_show326").height($("#iframe_show326").contents().find("body").height()+showittryitheight);
});
$("#iframe_show326").height($("#iframe_show326").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<p>无斜体效果</p>
<i>使用 i 标签带来的斜体效果</i>
<br/>
<em>使用 em 标签带来的斜体效果</em>
<p>无斜体效果</p>
<i>使用 i 标签带来的斜体效果</i>
<br/>
<em>使用 em 标签带来的斜体效果</em>
");
window.frames["iframe326"].document.write(decodeHtml(code326));
window.frames["iframe326"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe326"]).load(function(){
$("#iframe326").height($("#iframe326").contents().find("body").height()+showittryitheight);
});
$("#iframe326").height($("#iframe326").contents().find("body").height()+showittryitheight);
alreadyWriteCode326 = code326;
$("#rendering326").hide();
$("#rendered326").show();
}
var tRereshRetry2DemoPanel326 = setInterval(rereshRetry2DemoPanel326,1000);
var binded326 = false;
$("textarea#stepcodeTextarea326").keyup(function(){
if(!binded326){
$(window).bind('beforeunload',function(){
binded326 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code326 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code326!=newCode){
// window.frames["iframe326"].document.write("
");
// window.frames["iframe326"].document.write(decodeHtml($("textarea#stepcodeTextarea326").val()));
// window.frames["iframe326"].document.close();
// $(window.frames["iframe326"]).load(function(){
// $("#iframe326").height($("#iframe326").contents().find("body").height()+showittryitheight);
// });
// code326 = newCode;
// }
});
$(".tryButton326").click(function(){
$("#tryDiv326").show();
$("#stepcodeTextarea326").focus();
$("#stepcodeTextarea326").height(200);
$("#iframe326").height(0);
window.frames["iframe326"].document.write("
");
window.frames["iframe326"].document.write(decodeHtml($("textarea#stepcodeTextarea326").val()));
window.frames["iframe326"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe326"]).load(function(){
$("#iframe326").height($("#iframe326").contents().find("body").height()+showittryitheight);
});
$("#iframe326").height($("#iframe326").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor326.focus();
editor326.setSize(null, "250");
$("#rendering326").hide();
$("#rendered326").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 editor326 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea326"), {
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);
}
}
});
editor326.on("change",function(doc){
if(!binded326){
$(window).bind('beforeunload',function(){
binded326 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code326 = newCode;
$("textarea#stepcodeTextarea326").val(newCode);
if(alreadyWriteCode326!=code326){
lastModifedTime326 = new Date().getTime();
$("#rendering326").show();
$("#rendered326").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor326 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor326.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv326").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show327"].document.write(decodeHtml($("textarea#stepcodeTextarea327").val()));
window.frames["iframe_show327"].document.close();
$(window.frames["iframe_show327"]).load(function(){
$("#iframe_show327").height($("#iframe_show327").contents().find("body").height()+showittryitheight);
});
$("#iframe_show327").height($("#iframe_show327").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<p>无效果</p>
<strong>粗体</strong>
<br/>
<i>斜体</i>
<br/>
<strong><i>同时有粗体和斜体</i></strong>
<p>无效果</p>
<strong>粗体</strong>
<br/>
<i>斜体</i>
<br/>
<strong><i>同时有粗体和斜体</i></strong>
");
window.frames["iframe327"].document.write(decodeHtml(code327));
window.frames["iframe327"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe327"]).load(function(){
$("#iframe327").height($("#iframe327").contents().find("body").height()+showittryitheight);
});
$("#iframe327").height($("#iframe327").contents().find("body").height()+showittryitheight);
alreadyWriteCode327 = code327;
$("#rendering327").hide();
$("#rendered327").show();
}
var tRereshRetry2DemoPanel327 = setInterval(rereshRetry2DemoPanel327,1000);
var binded327 = false;
$("textarea#stepcodeTextarea327").keyup(function(){
if(!binded327){
$(window).bind('beforeunload',function(){
binded327 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code327 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code327!=newCode){
// window.frames["iframe327"].document.write("
");
// window.frames["iframe327"].document.write(decodeHtml($("textarea#stepcodeTextarea327").val()));
// window.frames["iframe327"].document.close();
// $(window.frames["iframe327"]).load(function(){
// $("#iframe327").height($("#iframe327").contents().find("body").height()+showittryitheight);
// });
// code327 = newCode;
// }
});
$(".tryButton327").click(function(){
$("#tryDiv327").show();
$("#stepcodeTextarea327").focus();
$("#stepcodeTextarea327").height(200);
$("#iframe327").height(0);
window.frames["iframe327"].document.write("
");
window.frames["iframe327"].document.write(decodeHtml($("textarea#stepcodeTextarea327").val()));
window.frames["iframe327"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe327"]).load(function(){
$("#iframe327").height($("#iframe327").contents().find("body").height()+showittryitheight);
});
$("#iframe327").height($("#iframe327").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor327.focus();
editor327.setSize(null, "250");
$("#rendering327").hide();
$("#rendered327").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 editor327 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea327"), {
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);
}
}
});
editor327.on("change",function(doc){
if(!binded327){
$(window).bind('beforeunload',function(){
binded327 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code327 = newCode;
$("textarea#stepcodeTextarea327").val(newCode);
if(alreadyWriteCode327!=code327){
lastModifedTime327 = new Date().getTime();
$("#rendering327").show();
$("#rendered327").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor327 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor327.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv327").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|