|
工具版本兼容问题
<a>标签即用来显示超链
完整元素是
<a href="跳转到的页面地址">超链显示文本</a>
示例
1
:
超链
示例
2
:
在新的页面打开超链
示例
3
:
超链上的提示文字
示例
4
:
使用图片作为超链
");
window.frames["iframe_show309"].document.write(decodeHtml($("textarea#stepcodeTextarea309").val()));
window.frames["iframe_show309"].document.close();
$(window.frames["iframe_show309"]).load(function(){
$("#iframe_show309").height($("#iframe_show309").contents().find("body").height()+showittryitheight);
});
$("#iframe_show309").height($("#iframe_show309").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<a href="http://www.12306.com">12306</a>
<a href="http://www.12306.com">12306</a>
");
window.frames["iframe309"].document.write(decodeHtml(code309));
window.frames["iframe309"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe309"]).load(function(){
$("#iframe309").height($("#iframe309").contents().find("body").height()+showittryitheight);
});
$("#iframe309").height($("#iframe309").contents().find("body").height()+showittryitheight);
alreadyWriteCode309 = code309;
$("#rendering309").hide();
$("#rendered309").show();
}
var tRereshRetry2DemoPanel309 = setInterval(rereshRetry2DemoPanel309,1000);
var binded309 = false;
$("textarea#stepcodeTextarea309").keyup(function(){
if(!binded309){
$(window).bind('beforeunload',function(){
binded309 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code309 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code309!=newCode){
// window.frames["iframe309"].document.write("
");
// window.frames["iframe309"].document.write(decodeHtml($("textarea#stepcodeTextarea309").val()));
// window.frames["iframe309"].document.close();
// $(window.frames["iframe309"]).load(function(){
// $("#iframe309").height($("#iframe309").contents().find("body").height()+showittryitheight);
// });
// code309 = newCode;
// }
});
$(".tryButton309").click(function(){
$("#tryDiv309").show();
$("#stepcodeTextarea309").focus();
$("#stepcodeTextarea309").height(200);
$("#iframe309").height(0);
window.frames["iframe309"].document.write("
");
window.frames["iframe309"].document.write(decodeHtml($("textarea#stepcodeTextarea309").val()));
window.frames["iframe309"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe309"]).load(function(){
$("#iframe309").height($("#iframe309").contents().find("body").height()+showittryitheight);
});
$("#iframe309").height($("#iframe309").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor309.focus();
editor309.setSize(null, "250");
$("#rendering309").hide();
$("#rendered309").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 editor309 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea309"), {
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);
}
}
});
editor309.on("change",function(doc){
if(!binded309){
$(window).bind('beforeunload',function(){
binded309 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code309 = newCode;
$("textarea#stepcodeTextarea309").val(newCode);
if(alreadyWriteCode309!=code309){
lastModifedTime309 = new Date().getTime();
$("#rendering309").show();
$("#rendered309").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor309 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor309.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv309").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show310"].document.write(decodeHtml($("textarea#stepcodeTextarea310").val()));
window.frames["iframe_show310"].document.close();
$(window.frames["iframe_show310"]).load(function(){
$("#iframe_show310").height($("#iframe_show310").contents().find("body").height()+showittryitheight);
});
$("#iframe_show310").height($("#iframe_show310").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<a href="http://www.12306.com" target="_blank">http://www.12306.com</a>
<a href="http://www.12306.com" target="_blank">http://www.12306.com</a>
");
window.frames["iframe310"].document.write(decodeHtml(code310));
window.frames["iframe310"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe310"]).load(function(){
$("#iframe310").height($("#iframe310").contents().find("body").height()+showittryitheight);
});
$("#iframe310").height($("#iframe310").contents().find("body").height()+showittryitheight);
alreadyWriteCode310 = code310;
$("#rendering310").hide();
$("#rendered310").show();
}
var tRereshRetry2DemoPanel310 = setInterval(rereshRetry2DemoPanel310,1000);
var binded310 = false;
$("textarea#stepcodeTextarea310").keyup(function(){
if(!binded310){
$(window).bind('beforeunload',function(){
binded310 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code310 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code310!=newCode){
// window.frames["iframe310"].document.write("
");
// window.frames["iframe310"].document.write(decodeHtml($("textarea#stepcodeTextarea310").val()));
// window.frames["iframe310"].document.close();
// $(window.frames["iframe310"]).load(function(){
// $("#iframe310").height($("#iframe310").contents().find("body").height()+showittryitheight);
// });
// code310 = newCode;
// }
});
$(".tryButton310").click(function(){
$("#tryDiv310").show();
$("#stepcodeTextarea310").focus();
$("#stepcodeTextarea310").height(200);
$("#iframe310").height(0);
window.frames["iframe310"].document.write("
");
window.frames["iframe310"].document.write(decodeHtml($("textarea#stepcodeTextarea310").val()));
window.frames["iframe310"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe310"]).load(function(){
$("#iframe310").height($("#iframe310").contents().find("body").height()+showittryitheight);
});
$("#iframe310").height($("#iframe310").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor310.focus();
editor310.setSize(null, "250");
$("#rendering310").hide();
$("#rendered310").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 editor310 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea310"), {
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);
}
}
});
editor310.on("change",function(doc){
if(!binded310){
$(window).bind('beforeunload',function(){
binded310 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code310 = newCode;
$("textarea#stepcodeTextarea310").val(newCode);
if(alreadyWriteCode310!=code310){
lastModifedTime310 = new Date().getTime();
$("#rendering310").show();
$("#rendered310").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor310 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor310.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv310").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show337"].document.write(decodeHtml($("textarea#stepcodeTextarea337").val()));
window.frames["iframe_show337"].document.close();
$(window.frames["iframe_show337"]).load(function(){
$("#iframe_show337").height($("#iframe_show337").contents().find("body").height()+showittryitheight);
});
$("#iframe_show337").height($("#iframe_show337").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<a href="http://www.12306.com" title="跳转到http://www.12306.com">www.12306.com</a>
<a href="http://www.12306.com" title="跳转到http://www.12306.com">www.12306.com</a>
");
window.frames["iframe337"].document.write(decodeHtml(code337));
window.frames["iframe337"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe337"]).load(function(){
$("#iframe337").height($("#iframe337").contents().find("body").height()+showittryitheight);
});
$("#iframe337").height($("#iframe337").contents().find("body").height()+showittryitheight);
alreadyWriteCode337 = code337;
$("#rendering337").hide();
$("#rendered337").show();
}
var tRereshRetry2DemoPanel337 = setInterval(rereshRetry2DemoPanel337,1000);
var binded337 = false;
$("textarea#stepcodeTextarea337").keyup(function(){
if(!binded337){
$(window).bind('beforeunload',function(){
binded337 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code337 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code337!=newCode){
// window.frames["iframe337"].document.write("
");
// window.frames["iframe337"].document.write(decodeHtml($("textarea#stepcodeTextarea337").val()));
// window.frames["iframe337"].document.close();
// $(window.frames["iframe337"]).load(function(){
// $("#iframe337").height($("#iframe337").contents().find("body").height()+showittryitheight);
// });
// code337 = newCode;
// }
});
$(".tryButton337").click(function(){
$("#tryDiv337").show();
$("#stepcodeTextarea337").focus();
$("#stepcodeTextarea337").height(200);
$("#iframe337").height(0);
window.frames["iframe337"].document.write("
");
window.frames["iframe337"].document.write(decodeHtml($("textarea#stepcodeTextarea337").val()));
window.frames["iframe337"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe337"]).load(function(){
$("#iframe337").height($("#iframe337").contents().find("body").height()+showittryitheight);
});
$("#iframe337").height($("#iframe337").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor337.focus();
editor337.setSize(null, "250");
$("#rendering337").hide();
$("#rendered337").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 editor337 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea337"), {
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);
}
}
});
editor337.on("change",function(doc){
if(!binded337){
$(window).bind('beforeunload',function(){
binded337 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code337 = newCode;
$("textarea#stepcodeTextarea337").val(newCode);
if(alreadyWriteCode337!=code337){
lastModifedTime337 = new Date().getTime();
$("#rendering337").show();
$("#rendered337").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor337 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor337.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv337").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
");
window.frames["iframe_show336"].document.write(decodeHtml($("textarea#stepcodeTextarea336").val()));
window.frames["iframe_show336"].document.close();
$(window.frames["iframe_show336"]).load(function(){
$("#iframe_show336").height($("#iframe_show336").contents().find("body").height()+showittryitheight);
});
$("#iframe_show336").height($("#iframe_show336").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<a href="http://www.12306.com">
<img src="http://127.0.0.1/example.gif"/>
</a>
<a href="http://www.12306.com">
<img src="http://127.0.0.1/example.gif"/>
</a>
");
window.frames["iframe336"].document.write(decodeHtml(code336));
window.frames["iframe336"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe336"]).load(function(){
$("#iframe336").height($("#iframe336").contents().find("body").height()+showittryitheight);
});
$("#iframe336").height($("#iframe336").contents().find("body").height()+showittryitheight);
alreadyWriteCode336 = code336;
$("#rendering336").hide();
$("#rendered336").show();
}
var tRereshRetry2DemoPanel336 = setInterval(rereshRetry2DemoPanel336,1000);
var binded336 = false;
$("textarea#stepcodeTextarea336").keyup(function(){
if(!binded336){
$(window).bind('beforeunload',function(){
binded336 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code336 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code336!=newCode){
// window.frames["iframe336"].document.write("
");
// window.frames["iframe336"].document.write(decodeHtml($("textarea#stepcodeTextarea336").val()));
// window.frames["iframe336"].document.close();
// $(window.frames["iframe336"]).load(function(){
// $("#iframe336").height($("#iframe336").contents().find("body").height()+showittryitheight);
// });
// code336 = newCode;
// }
});
$(".tryButton336").click(function(){
$("#tryDiv336").show();
$("#stepcodeTextarea336").focus();
$("#stepcodeTextarea336").height(200);
$("#iframe336").height(0);
window.frames["iframe336"].document.write("
");
window.frames["iframe336"].document.write(decodeHtml($("textarea#stepcodeTextarea336").val()));
window.frames["iframe336"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe336"]).load(function(){
$("#iframe336").height($("#iframe336").contents().find("body").height()+showittryitheight);
});
$("#iframe336").height($("#iframe336").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor336.focus();
editor336.setSize(null, "250");
$("#rendering336").hide();
$("#rendered336").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 editor336 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea336"), {
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);
}
}
});
editor336.on("change",function(doc){
if(!binded336){
$(window).bind('beforeunload',function(){
binded336 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code336 = newCode;
$("textarea#stepcodeTextarea336").val(newCode);
if(alreadyWriteCode336!=code336){
lastModifedTime336 = new Date().getTime();
$("#rendering336").show();
$("#rendered336").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor336 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor336.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv336").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|