");
window.frames["iframe_show3185"].document.write(decodeHtml($("textarea#stepcodeTextarea3185").val()));
window.frames["iframe_show3185"].document.close();
$(window.frames["iframe_show3185"]).load(function(){
$("#iframe_show3185").height($("#iframe_show3185").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3185").height($("#iframe_show3185").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.categoryWithCarousel{
width: 100%;
position:relative;
}
div.categoryWithCarousel div.headbar{
background-color: #DD2727;
}
div.categoryWithCarousel div.head{
width: 200px;
background-color: #C60A0A;
height: 36px;
line-height: 36px;
font-size: 16px;
font-weight: bold;
color: white;
margin-left: 20px;
display: inline-block;
}
div.categoryWithCarousel div.rightMenu{
display: inline-block;
}
div.categoryWithCarousel div.rightMenu a{
font-size: 16px;
color: white;
text-decoration:none;
}
div.categoryWithCarousel div.rightMenu span{
margin: 0px 20px 0px 20px;
}
div.categoryWithCarousel div.rightMenu img{
height: 30px;
}
div.carousel-of-product{
height: 510px;
width:1024px;
margin:0px auto;
}
img.carouselImage{
height: 510px !important;
}
div.carouselBackgroundDiv{
width:100%;
height:510px;
background-color:#E8E8E8;
position:absolute;
top:36px;
z-index:-1;
}
</style>
<div class="categoryWithCarousel">
<div class="headbar">
<div class="head ">
<span class="glyphicon glyphicon-th-list" style="margin-left:10px"></span>
<span style="margin-left:10px">商品分类</span>
</div>
<div class="rightMenu">
<span><a href="#nowhere"><img src="http://127.0.0.1/tmall../../../img/site/chaoshi.png"></a></span>
<span><a href="#nowhere"><img src="http://127.0.0.1/tmall../../../img/site/guoji.png"></a></span>
<span>
<a href="#nowhere">
平板电视
</a></span>
<span>
<a href="#nowhere">
电热水器
</a></span>
</div>
</div>
<div data-ride="carousel" class="carousel-of-product carousel slide" id="carousel-of-product">
<!-- Indicators -->
<ol class="carousel-indicators">
<li class="active" data-slide-to="0" data-target="#carousel-of-product"></li>
<li data-slide-to="1" data-target="#carousel-of-product" class=""></li>
<li data-slide-to="2" data-target="#carousel-of-product" class=""></li>
<li data-slide-to="3" data-target="#carousel-of-product" class=""></li>
</ol>
<!-- Wrapper for slides -->
<div role="listbox" class="carousel-inner">
<div class="item active">
<img src="http://127.0.0.1/tmall/img/lunbo/1.jpg" class="carousel carouselImage">
</div>
<div class="item">
<img src="http://127.0.0.1/tmall/img/lunbo/2.jpg" class="carouselImage">
</div>
<div class="item">
<img src="http://127.0.0.1/tmall/img/lunbo/3.jpg" class="carouselImage">
</div>
<div class="item">
<img src="http://127.0.0.1/tmall/img/lunbo/4.jpg" class="carouselImage">
</div>
</div>
</div>
<div class="carouselBackgroundDiv">
</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.categoryWithCarousel{
width: 100%;
position:relative;
}
div.categoryWithCarousel div.headbar{
background-color: #DD2727;
}
div.categoryWithCarousel div.head{
width: 200px;
background-color: #C60A0A;
height: 36px;
line-height: 36px;
font-size: 16px;
font-weight: bold;
color: white;
margin-left: 20px;
display: inline-block;
}
div.categoryWithCarousel div.rightMenu{
display: inline-block;
}
div.categoryWithCarousel div.rightMenu a{
font-size: 16px;
color: white;
text-decoration:none;
}
div.categoryWithCarousel div.rightMenu span{
margin: 0px 20px 0px 20px;
}
div.categoryWithCarousel div.rightMenu img{
height: 30px;
}
div.carousel-of-product{
height: 510px;
width:1024px;
margin:0px auto;
}
img.carouselImage{
height: 510px !important;
}
div.carouselBackgroundDiv{
width:100%;
height:510px;
background-color:#E8E8E8;
position:absolute;
top:36px;
z-index:-1;
}
</style>
<div class="categoryWithCarousel">
<div class="headbar">
<div class="head ">
<span class="glyphicon glyphicon-th-list" style="margin-left:10px"></span>
<span style="margin-left:10px">商品分类</span>
</div>
<div class="rightMenu">
<span><a href="#nowhere"><img src="http://127.0.0.1/tmall../../../img/site/chaoshi.png"></a></span>
<span><a href="#nowhere"><img src="http://127.0.0.1/tmall../../../img/site/guoji.png"></a></span>
<span>
<a href="#nowhere">
平板电视
</a></span>
<span>
<a href="#nowhere">
电热水器
</a></span>
</div>
</div>
<div data-ride="carousel" class="carousel-of-product carousel slide" id="carousel-of-product">
<!-- Indicators -->
<ol class="carousel-indicators">
<li class="active" data-slide-to="0" data-target="#carousel-of-product"></li>
<li data-slide-to="1" data-target="#carousel-of-product" class=""></li>
<li data-slide-to="2" data-target="#carousel-of-product" class=""></li>
<li data-slide-to="3" data-target="#carousel-of-product" class=""></li>
</ol>
<!-- Wrapper for slides -->
<div role="listbox" class="carousel-inner">
<div class="item active">
<img src="http://127.0.0.1/tmall/img/lunbo/1.jpg" class="carousel carouselImage">
</div>
<div class="item">
<img src="http://127.0.0.1/tmall/img/lunbo/2.jpg" class="carouselImage">
</div>
<div class="item">
<img src="http://127.0.0.1/tmall/img/lunbo/3.jpg" class="carouselImage">
</div>
<div class="item">
<img src="http://127.0.0.1/tmall/img/lunbo/4.jpg" class="carouselImage">
</div>
</div>
</div>
<div class="carouselBackgroundDiv">
</div>
</div>
");
window.frames["iframe3185"].document.write(decodeHtml(code3185));
window.frames["iframe3185"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3185"]).load(function(){
$("#iframe3185").height($("#iframe3185").contents().find("body").height()+showittryitheight);
});
$("#iframe3185").height($("#iframe3185").contents().find("body").height()+showittryitheight);
alreadyWriteCode3185 = code3185;
$("#rendering3185").hide();
$("#rendered3185").show();
}
var tRereshRetry2DemoPanel3185 = setInterval(rereshRetry2DemoPanel3185,1000);
var binded3185 = false;
$("textarea#stepcodeTextarea3185").keyup(function(){
if(!binded3185){
$(window).bind('beforeunload',function(){
binded3185 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3185 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3185!=newCode){
// window.frames["iframe3185"].document.write("
");
// window.frames["iframe3185"].document.write(decodeHtml($("textarea#stepcodeTextarea3185").val()));
// window.frames["iframe3185"].document.close();
// $(window.frames["iframe3185"]).load(function(){
// $("#iframe3185").height($("#iframe3185").contents().find("body").height()+showittryitheight);
// });
// code3185 = newCode;
// }
});
$(".tryButton3185").click(function(){
$("#tryDiv3185").show();
$("#stepcodeTextarea3185").focus();
$("#stepcodeTextarea3185").height(200);
$("#iframe3185").height(0);
window.frames["iframe3185"].document.write("
");
window.frames["iframe3185"].document.write(decodeHtml($("textarea#stepcodeTextarea3185").val()));
window.frames["iframe3185"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3185"]).load(function(){
$("#iframe3185").height($("#iframe3185").contents().find("body").height()+showittryitheight);
});
$("#iframe3185").height($("#iframe3185").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3185.focus();
editor3185.setSize(null, "250");
$("#rendering3185").hide();
$("#rendered3185").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 editor3185 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3185"), {
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);
}
}
});
editor3185.on("change",function(doc){
if(!binded3185){
$(window).bind('beforeunload',function(){
binded3185 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3185 = newCode;
$("textarea#stepcodeTextarea3185").val(newCode);
if(alreadyWriteCode3185!=code3185){
lastModifedTime3185 = new Date().getTime();
$("#rendering3185").show();
$("#rendered3185").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3185 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3185.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3185").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|