|
关键字 |
简介 |
示例代码 |
first() last() eq(num)
|
第一个 最后一个 第几个
|
示例代码
|
parent() parents()
|
父 祖先
|
示例代码
|
children() find()
|
儿子 后代
|
示例代码
|
siblings()
|
同级
|
示例代码
|
示例
1
:
第一个 最后一个 第几个
示例
2
:
父 祖先
示例
3
:
儿子 后代
示例
4
:
同级
首先通过 $("div") 选择了多个div元素,接下来做进一步的筛选 first() 第1个元素 last() 最后一个元素 eq(num) 第num个元素 注: num基0
");
window.frames["iframe_show1247"].document.write(decodeHtml($("textarea#stepcodeTextarea1247").val()));
window.frames["iframe_show1247"].document.close();
$(window.frames["iframe_show1247"]).load(function(){
$("#iframe_show1247").height($("#iframe_show1247").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1247").height($("#iframe_show1247").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<script src="http://127.0.0.1/study/jquery.min.js"></script>
<script>
$(function(){
$("#b1").click(function(){
$("div").first().toggleClass("pink");
});
$("#b2").click(function(){
$("div").last().toggleClass("pink");
});
$("#b3").click(function(){
$("div").eq(4).toggleClass("pink");
});
});
</script>
<button id="b1">切换第1个div背景色</button>
<button id="b2">切换最后1个div背景色</button>
<button id="b3">切换第5个div背景色</button>
<br>
<br>
<style>
.pink{
background-color:pink;
}
</style>
<div>
<span>Hello JQuery 1</span>
</div>
<div >
<span>Hello JQuery 2</span>
</div>
<div >
<span>Hello JQuery 3</span>
</div>
<div >
<span>Hello JQuery 4</span>
</div>
</div>
<div >
<span>Hello JQuery 5</span>
</div>
<div >
<span>Hello JQuery 6</span>
</div>
<script src="http://127.0.0.1/study/jquery.min.js"></script>
<script>
$(function(){
$("#b1").click(function(){
$("div").first().toggleClass("pink");
});
$("#b2").click(function(){
$("div").last().toggleClass("pink");
});
$("#b3").click(function(){
$("div").eq(4).toggleClass("pink");
});
});
</script>
<button id="b1">切换第1个div背景色</button>
<button id="b2">切换最后1个div背景色</button>
<button id="b3">切换第5个div背景色</button>
<br>
<br>
<style>
.pink{
background-color:pink;
}
</style>
<div>
<span>Hello JQuery 1</span>
</div>
<div >
<span>Hello JQuery 2</span>
</div>
<div >
<span>Hello JQuery 3</span>
</div>
<div >
<span>Hello JQuery 4</span>
</div>
</div>
<div >
<span>Hello JQuery 5</span>
</div>
<div >
<span>Hello JQuery 6</span>
</div>
");
window.frames["iframe1247"].document.write(decodeHtml(code1247));
window.frames["iframe1247"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1247"]).load(function(){
$("#iframe1247").height($("#iframe1247").contents().find("body").height()+showittryitheight);
});
$("#iframe1247").height($("#iframe1247").contents().find("body").height()+showittryitheight);
alreadyWriteCode1247 = code1247;
$("#rendering1247").hide();
$("#rendered1247").show();
}
var tRereshRetry2DemoPanel1247 = setInterval(rereshRetry2DemoPanel1247,1000);
var binded1247 = false;
$("textarea#stepcodeTextarea1247").keyup(function(){
if(!binded1247){
$(window).bind('beforeunload',function(){
binded1247 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1247 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1247!=newCode){
// window.frames["iframe1247"].document.write("
");
// window.frames["iframe1247"].document.write(decodeHtml($("textarea#stepcodeTextarea1247").val()));
// window.frames["iframe1247"].document.close();
// $(window.frames["iframe1247"]).load(function(){
// $("#iframe1247").height($("#iframe1247").contents().find("body").height()+showittryitheight);
// });
// code1247 = newCode;
// }
});
$(".tryButton1247").click(function(){
$("#tryDiv1247").show();
$("#stepcodeTextarea1247").focus();
$("#stepcodeTextarea1247").height(200);
$("#iframe1247").height(0);
window.frames["iframe1247"].document.write("
");
window.frames["iframe1247"].document.write(decodeHtml($("textarea#stepcodeTextarea1247").val()));
window.frames["iframe1247"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1247"]).load(function(){
$("#iframe1247").height($("#iframe1247").contents().find("body").height()+showittryitheight);
});
$("#iframe1247").height($("#iframe1247").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1247.focus();
editor1247.setSize(null, "250");
$("#rendering1247").hide();
$("#rendered1247").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 editor1247 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1247"), {
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);
}
}
});
editor1247.on("change",function(doc){
if(!binded1247){
$(window).bind('beforeunload',function(){
binded1247 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1247 = newCode;
$("textarea#stepcodeTextarea1247").val(newCode);
if(alreadyWriteCode1247!=code1247){
lastModifedTime1247 = new Date().getTime();
$("#rendering1247").show();
$("#rendered1247").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1247 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1247.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1247").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
parent() 选取最近的一个父元素
parents() 选取所有的祖先元素
");
window.frames["iframe_show1248"].document.write(decodeHtml($("textarea#stepcodeTextarea1248").val()));
window.frames["iframe_show1248"].document.close();
$(window.frames["iframe_show1248"]).load(function(){
$("#iframe_show1248").height($("#iframe_show1248").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1248").height($("#iframe_show1248").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<script src="http://127.0.0.1/study/jquery.min.js"></script>
<script>
$(function(){
$("#b1").click(function(){
$("#currentDiv").parent().toggleClass("b");
});
$("#b2").click(function(){
$("#currentDiv").parents().toggleClass("b");
});
});
</script>
<style>
div{
padding:20px;
}
div#grandParentDiv{
background-color:pink;
}
div#parentDiv{
background-color:green;
}
div#currentDiv{
background-color:red;
}
.b{
border: 2px solid black;
}
</style>
<button id="b1">改变parent()的边框</button>
<button id="b2">改变parents()的边框</button>
<div id="grandParentDiv" >
祖先元素
<div id="parentDiv">
父元素
<div id="currentDiv">当前元素</div>
</div>
</div>
<script src="http://127.0.0.1/study/jquery.min.js"></script>
<script>
$(function(){
$("#b1").click(function(){
$("#currentDiv").parent().toggleClass("b");
});
$("#b2").click(function(){
$("#currentDiv").parents().toggleClass("b");
});
});
</script>
<style>
div{
padding:20px;
}
div#grandParentDiv{
background-color:pink;
}
div#parentDiv{
background-color:green;
}
div#currentDiv{
background-color:red;
}
.b{
border: 2px solid black;
}
</style>
<button id="b1">改变parent()的边框</button>
<button id="b2">改变parents()的边框</button>
<div id="grandParentDiv" >
祖先元素
<div id="parentDiv">
父元素
<div id="currentDiv">当前元素</div>
</div>
</div>
");
window.frames["iframe1248"].document.write(decodeHtml(code1248));
window.frames["iframe1248"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1248"]).load(function(){
$("#iframe1248").height($("#iframe1248").contents().find("body").height()+showittryitheight);
});
$("#iframe1248").height($("#iframe1248").contents().find("body").height()+showittryitheight);
alreadyWriteCode1248 = code1248;
$("#rendering1248").hide();
$("#rendered1248").show();
}
var tRereshRetry2DemoPanel1248 = setInterval(rereshRetry2DemoPanel1248,1000);
var binded1248 = false;
$("textarea#stepcodeTextarea1248").keyup(function(){
if(!binded1248){
$(window).bind('beforeunload',function(){
binded1248 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1248 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1248!=newCode){
// window.frames["iframe1248"].document.write("
");
// window.frames["iframe1248"].document.write(decodeHtml($("textarea#stepcodeTextarea1248").val()));
// window.frames["iframe1248"].document.close();
// $(window.frames["iframe1248"]).load(function(){
// $("#iframe1248").height($("#iframe1248").contents().find("body").height()+showittryitheight);
// });
// code1248 = newCode;
// }
});
$(".tryButton1248").click(function(){
$("#tryDiv1248").show();
$("#stepcodeTextarea1248").focus();
$("#stepcodeTextarea1248").height(200);
$("#iframe1248").height(0);
window.frames["iframe1248"].document.write("
");
window.frames["iframe1248"].document.write(decodeHtml($("textarea#stepcodeTextarea1248").val()));
window.frames["iframe1248"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1248"]).load(function(){
$("#iframe1248").height($("#iframe1248").contents().find("body").height()+showittryitheight);
});
$("#iframe1248").height($("#iframe1248").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1248.focus();
editor1248.setSize(null, "250");
$("#rendering1248").hide();
$("#rendered1248").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 editor1248 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1248"), {
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);
}
}
});
editor1248.on("change",function(doc){
if(!binded1248){
$(window).bind('beforeunload',function(){
binded1248 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1248 = newCode;
$("textarea#stepcodeTextarea1248").val(newCode);
if(alreadyWriteCode1248!=code1248){
lastModifedTime1248 = new Date().getTime();
$("#rendering1248").show();
$("#rendered1248").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1248 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1248.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1248").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
children(): 筛选出儿子元素 (紧挨着的子元素)
find(selector): 筛选出后代元素
注: find() 必须使用参数 selector
");
window.frames["iframe_show1249"].document.write(decodeHtml($("textarea#stepcodeTextarea1249").val()));
window.frames["iframe_show1249"].document.close();
$(window.frames["iframe_show1249"]).load(function(){
$("#iframe_show1249").height($("#iframe_show1249").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1249").height($("#iframe_show1249").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<script src="http://127.0.0.1/study/jquery.min.js"></script>
<script>
$(function(){
$("#b1").click(function(){
$("#currentDiv").children().toggleClass("b");
});
$("#b2").click(function(){
$("#currentDiv").find("div").toggleClass("b");
});
});
</script>
<style>
div{
padding:20px;
}
div.grandChildrenDiv{
background-color:pink;
}
div.childrenDiv{
background-color:green;
margin:10px;
}
div#currentDiv{
background-color:red;
}
.b{
border: 2px solid black;
}
</style>
<button id="b1">改变children()的边框</button>
<button id="b2">改变find()的边框</button>
<div id="currentDiv" >
当前元素
<div class="childrenDiv">
儿子元素1
<div class="grandChildrenDiv">后代元素n</div>
</div>
<div class="childrenDiv">
儿子元素2
<div class="grandChildrenDiv">后代元素n</div>
</div>
</div>
<script src="http://127.0.0.1/study/jquery.min.js"></script>
<script>
$(function(){
$("#b1").click(function(){
$("#currentDiv").children().toggleClass("b");
});
$("#b2").click(function(){
$("#currentDiv").find("div").toggleClass("b");
});
});
</script>
<style>
div{
padding:20px;
}
div.grandChildrenDiv{
background-color:pink;
}
div.childrenDiv{
background-color:green;
margin:10px;
}
div#currentDiv{
background-color:red;
}
.b{
border: 2px solid black;
}
</style>
<button id="b1">改变children()的边框</button>
<button id="b2">改变find()的边框</button>
<div id="currentDiv" >
当前元素
<div class="childrenDiv">
儿子元素1
<div class="grandChildrenDiv">后代元素n</div>
</div>
<div class="childrenDiv">
儿子元素2
<div class="grandChildrenDiv">后代元素n</div>
</div>
</div>
");
window.frames["iframe1249"].document.write(decodeHtml(code1249));
window.frames["iframe1249"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1249"]).load(function(){
$("#iframe1249").height($("#iframe1249").contents().find("body").height()+showittryitheight);
});
$("#iframe1249").height($("#iframe1249").contents().find("body").height()+showittryitheight);
alreadyWriteCode1249 = code1249;
$("#rendering1249").hide();
$("#rendered1249").show();
}
var tRereshRetry2DemoPanel1249 = setInterval(rereshRetry2DemoPanel1249,1000);
var binded1249 = false;
$("textarea#stepcodeTextarea1249").keyup(function(){
if(!binded1249){
$(window).bind('beforeunload',function(){
binded1249 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1249 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1249!=newCode){
// window.frames["iframe1249"].document.write("
");
// window.frames["iframe1249"].document.write(decodeHtml($("textarea#stepcodeTextarea1249").val()));
// window.frames["iframe1249"].document.close();
// $(window.frames["iframe1249"]).load(function(){
// $("#iframe1249").height($("#iframe1249").contents().find("body").height()+showittryitheight);
// });
// code1249 = newCode;
// }
});
$(".tryButton1249").click(function(){
$("#tryDiv1249").show();
$("#stepcodeTextarea1249").focus();
$("#stepcodeTextarea1249").height(200);
$("#iframe1249").height(0);
window.frames["iframe1249"].document.write("
");
window.frames["iframe1249"].document.write(decodeHtml($("textarea#stepcodeTextarea1249").val()));
window.frames["iframe1249"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1249"]).load(function(){
$("#iframe1249").height($("#iframe1249").contents().find("body").height()+showittryitheight);
});
$("#iframe1249").height($("#iframe1249").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1249.focus();
editor1249.setSize(null, "250");
$("#rendering1249").hide();
$("#rendered1249").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 editor1249 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1249"), {
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);
}
}
});
editor1249.on("change",function(doc){
if(!binded1249){
$(window).bind('beforeunload',function(){
binded1249 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1249 = newCode;
$("textarea#stepcodeTextarea1249").val(newCode);
if(alreadyWriteCode1249!=code1249){
lastModifedTime1249 = new Date().getTime();
$("#rendering1249").show();
$("#rendered1249").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1249 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1249.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1249").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show1250"].document.write(decodeHtml($("textarea#stepcodeTextarea1250").val()));
window.frames["iframe_show1250"].document.close();
$(window.frames["iframe_show1250"]).load(function(){
$("#iframe_show1250").height($("#iframe_show1250").contents().find("body").height()+showittryitheight);
});
$("#iframe_show1250").height($("#iframe_show1250").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<script src="http://127.0.0.1/study/jquery.min.js"></script>
<script>
$(function(){
$("#b1").click(function(){
$("#currentDiv").siblings().toggleClass("b");
});
});
</script>
<style>
div{
padding:20px;
background-color:pink;
margin:10px;
}
div#parentDiv{
background-color:green;
}
div#currentDiv{
background-color:red;
}
.b{
border: 2px solid black;
}
</style>
<button id="b1">给同级加上边框</button>
<div id="parentDiv" >
父元素
<div id="currentDiv">
当前元素
</div>
<div >
同级元素
</div>
<div >
同级元素
</div>
</div>
<script src="http://127.0.0.1/study/jquery.min.js"></script>
<script>
$(function(){
$("#b1").click(function(){
$("#currentDiv").siblings().toggleClass("b");
});
});
</script>
<style>
div{
padding:20px;
background-color:pink;
margin:10px;
}
div#parentDiv{
background-color:green;
}
div#currentDiv{
background-color:red;
}
.b{
border: 2px solid black;
}
</style>
<button id="b1">给同级加上边框</button>
<div id="parentDiv" >
父元素
<div id="currentDiv">
当前元素
</div>
<div >
同级元素
</div>
<div >
同级元素
</div>
</div>
");
window.frames["iframe1250"].document.write(decodeHtml(code1250));
window.frames["iframe1250"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1250"]).load(function(){
$("#iframe1250").height($("#iframe1250").contents().find("body").height()+showittryitheight);
});
$("#iframe1250").height($("#iframe1250").contents().find("body").height()+showittryitheight);
alreadyWriteCode1250 = code1250;
$("#rendering1250").hide();
$("#rendered1250").show();
}
var tRereshRetry2DemoPanel1250 = setInterval(rereshRetry2DemoPanel1250,1000);
var binded1250 = false;
$("textarea#stepcodeTextarea1250").keyup(function(){
if(!binded1250){
$(window).bind('beforeunload',function(){
binded1250 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code1250 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code1250!=newCode){
// window.frames["iframe1250"].document.write("
");
// window.frames["iframe1250"].document.write(decodeHtml($("textarea#stepcodeTextarea1250").val()));
// window.frames["iframe1250"].document.close();
// $(window.frames["iframe1250"]).load(function(){
// $("#iframe1250").height($("#iframe1250").contents().find("body").height()+showittryitheight);
// });
// code1250 = newCode;
// }
});
$(".tryButton1250").click(function(){
$("#tryDiv1250").show();
$("#stepcodeTextarea1250").focus();
$("#stepcodeTextarea1250").height(200);
$("#iframe1250").height(0);
window.frames["iframe1250"].document.write("
");
window.frames["iframe1250"].document.write(decodeHtml($("textarea#stepcodeTextarea1250").val()));
window.frames["iframe1250"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe1250"]).load(function(){
$("#iframe1250").height($("#iframe1250").contents().find("body").height()+showittryitheight);
});
$("#iframe1250").height($("#iframe1250").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor1250.focus();
editor1250.setSize(null, "250");
$("#rendering1250").hide();
$("#rendered1250").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 editor1250 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea1250"), {
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);
}
}
});
editor1250.on("change",function(doc){
if(!binded1250){
$(window).bind('beforeunload',function(){
binded1250 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code1250 = newCode;
$("textarea#stepcodeTextarea1250").val(newCode);
if(alreadyWriteCode1250!=code1250){
lastModifedTime1250 = new Date().getTime();
$("#rendering1250").show();
$("#rendered1250").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor1250 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor1250.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv1250").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|