");
window.frames["iframe_show3214"].document.write(decodeHtml($("textarea#stepcodeTextarea3214").val()));
window.frames["iframe_show3214"].document.close();
$(window.frames["iframe_show3214"]).load(function(){
$("#iframe_show3214").height($("#iframe_show3214").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3214").height($("#iframe_show3214").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>
</head>
<style>
div.categoryPageDiv{
max-width: 1013px;
margin: 10px auto;
}
div.categorySortBar{
background-color: #FAF9F9;
margin: 40px 20px 20px 20px;
padding: 4px;
}
table.categorySortBarTable{
border-collapse: collapse;
display:inline-block;
}
table.categorySortBarTable span.glyphicon{
font-size: 10px;
}
table.categorySortBarTable td{
height:17px;
font-size:12px;
border:1px solid #CCCCCC;
padding:3px;
}
table.categorySortBarTable td.grayColumn{
background-color: #F1EDEC;
}
table.categorySortBarTable td a{
color: #806F66;
}
table.categorySortBarTable td a:hover{
color: #C40000;
}
table.categorySortBarTable input{
border-width: 0px;
height: 15px;
width: 50px;
}
table.categorySortBarTable td.priceMiddleColumn{
width: 5px;
vertical-align: middle;
color: #CCCCCC;
}
table.categorySortTable td:hover{
background-color: #F1EDEC;
}
body{
font-size: 12px ;
font-family: Arial;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="categoryPageDiv">
<img src="http://127.0.0.1/tmall/img/category/72.jpg">
<div class="categorySortBar">
<table class="categorySortBarTable categorySortTable">
<tbody><tr>
<td class="grayColumn"><a href="#nowhere">综合<span class="glyphicon glyphicon-arrow-down"></span></a></td>
<td><a href="#nowhere">人气<span class="glyphicon glyphicon-arrow-down"></span></a></td>
<td><a href="#nowhere">新品<span class="glyphicon glyphicon-arrow-down"></span></a></td>
<td><a href="#nowhere">销量<span class="glyphicon glyphicon-arrow-down"></span></a></td>
<td><a href="#nowhere">价格<span class="glyphicon glyphicon-resize-vertical"></span></a></td>
</tr>
</tbody></table>
<table class="categorySortBarTable">
<tbody><tr>
<td><input type="text" placeholder="请输入" class="sortBarPrice beginPrice"></td>
<td class="grayColumn priceMiddleColumn">-</td>
<td><input type="text" placeholder="请输入" class="sortBarPrice endPrice"></td>
</tr>
</tbody></table>
</div>
</div>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>
</head>
<style>
div.categoryPageDiv{
max-width: 1013px;
margin: 10px auto;
}
div.categorySortBar{
background-color: #FAF9F9;
margin: 40px 20px 20px 20px;
padding: 4px;
}
table.categorySortBarTable{
border-collapse: collapse;
display:inline-block;
}
table.categorySortBarTable span.glyphicon{
font-size: 10px;
}
table.categorySortBarTable td{
height:17px;
font-size:12px;
border:1px solid #CCCCCC;
padding:3px;
}
table.categorySortBarTable td.grayColumn{
background-color: #F1EDEC;
}
table.categorySortBarTable td a{
color: #806F66;
}
table.categorySortBarTable td a:hover{
color: #C40000;
}
table.categorySortBarTable input{
border-width: 0px;
height: 15px;
width: 50px;
}
table.categorySortBarTable td.priceMiddleColumn{
width: 5px;
vertical-align: middle;
color: #CCCCCC;
}
table.categorySortTable td:hover{
background-color: #F1EDEC;
}
body{
font-size: 12px ;
font-family: Arial;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="categoryPageDiv">
<img src="http://127.0.0.1/tmall/img/category/72.jpg">
<div class="categorySortBar">
<table class="categorySortBarTable categorySortTable">
<tbody><tr>
<td class="grayColumn"><a href="#nowhere">综合<span class="glyphicon glyphicon-arrow-down"></span></a></td>
<td><a href="#nowhere">人气<span class="glyphicon glyphicon-arrow-down"></span></a></td>
<td><a href="#nowhere">新品<span class="glyphicon glyphicon-arrow-down"></span></a></td>
<td><a href="#nowhere">销量<span class="glyphicon glyphicon-arrow-down"></span></a></td>
<td><a href="#nowhere">价格<span class="glyphicon glyphicon-resize-vertical"></span></a></td>
</tr>
</tbody></table>
<table class="categorySortBarTable">
<tbody><tr>
<td><input type="text" placeholder="请输入" class="sortBarPrice beginPrice"></td>
<td class="grayColumn priceMiddleColumn">-</td>
<td><input type="text" placeholder="请输入" class="sortBarPrice endPrice"></td>
</tr>
</tbody></table>
</div>
</div>
");
window.frames["iframe3214"].document.write(decodeHtml(code3214));
window.frames["iframe3214"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3214"]).load(function(){
$("#iframe3214").height($("#iframe3214").contents().find("body").height()+showittryitheight);
});
$("#iframe3214").height($("#iframe3214").contents().find("body").height()+showittryitheight);
alreadyWriteCode3214 = code3214;
$("#rendering3214").hide();
$("#rendered3214").show();
}
var tRereshRetry2DemoPanel3214 = setInterval(rereshRetry2DemoPanel3214,1000);
var binded3214 = false;
$("textarea#stepcodeTextarea3214").keyup(function(){
if(!binded3214){
$(window).bind('beforeunload',function(){
binded3214 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3214 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3214!=newCode){
// window.frames["iframe3214"].document.write("
");
// window.frames["iframe3214"].document.write(decodeHtml($("textarea#stepcodeTextarea3214").val()));
// window.frames["iframe3214"].document.close();
// $(window.frames["iframe3214"]).load(function(){
// $("#iframe3214").height($("#iframe3214").contents().find("body").height()+showittryitheight);
// });
// code3214 = newCode;
// }
});
$(".tryButton3214").click(function(){
$("#tryDiv3214").show();
$("#stepcodeTextarea3214").focus();
$("#stepcodeTextarea3214").height(200);
$("#iframe3214").height(0);
window.frames["iframe3214"].document.write("
");
window.frames["iframe3214"].document.write(decodeHtml($("textarea#stepcodeTextarea3214").val()));
window.frames["iframe3214"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3214"]).load(function(){
$("#iframe3214").height($("#iframe3214").contents().find("body").height()+showittryitheight);
});
$("#iframe3214").height($("#iframe3214").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3214.focus();
editor3214.setSize(null, "250");
$("#rendering3214").hide();
$("#rendered3214").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 editor3214 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3214"), {
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);
}
}
});
editor3214.on("change",function(doc){
if(!binded3214){
$(window).bind('beforeunload',function(){
binded3214 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3214 = newCode;
$("textarea#stepcodeTextarea3214").val(newCode);
if(alreadyWriteCode3214!=code3214){
lastModifedTime3214 = new Date().getTime();
$("#rendering3214").show();
$("#rendered3214").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3214 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3214.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3214").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|