每种商品都有5个详细图片,而且这些图片都比较大。 为了加快显示的速度,讲解的时候,只使用一个图片。
");
window.frames["iframe_show3241"].document.write(decodeHtml($("textarea#stepcodeTextarea3241").val()));
window.frames["iframe_show3241"].document.close();
$(window.frames["iframe_show3241"]).load(function(){
$("#iframe_show3241").height($("#iframe_show3241").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3241").height($("#iframe_show3241").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.productDetailDiv{
width: 790px;
margin: 40px auto;
}
div.productDetailTopPart{
border: 1px solid #DFDFDF;
border-left-width: 0px;
}
a.selected{
border-left: 1px solid #cfbfb1;
border-right: 1px solid #cfbfb1;
color: #b10000;
display: inline-block;
font-weight: bold;
line-height: 46px;
width: 90px;
text-align: center;
position: relative;
}
a.selected:before{
content:"";
display: block;
border-width: 1px;
border-color: #b00000;
border-style: solid;
width: 90px;
height: 0;
position: absolute;
top: -1px;
margin-left: -1px;
}
a.selected:after{
content: "";
display: block;
border-color: #b00000 transparent transparent;
border-style: solid;
border-width: 5px;
width: 0;
height: 0;
position: absolute;
top: -1px;
left: 50%;
margin-left: -5px;
}
a.productDetailTopReviewLink{
padding: 0px 20px;
border-right: 1px dotted #D2D2D2;
color: #333333;
}
span.productDetailTopReviewLinkNumber{
color: #3355B9;
}
div.productParamterPart{
border: 1px solid #DFDFDF;
padding: 40px;
}
div.productParamter{
color: #999999;
font-weight: bold;
margin-bottom: 20px;
}
div.productParamterList span{
display: block;
width: 220px;
float: left;
padding: 8px 0px;
color: #666666;
}
div.productDetailImagesPart img{
display: block;
width: 790px;
margin:20px 0px;
}
body{
font-size: 12px;
font-family: Arial;
}
a:hover{
text-decoration:none;
color: #C40000;
}
</style>
<div class="productDetailDiv" style="display: block;">
<div class="productDetailTopPart">
<a class="productDetailTopPartSelectedLink selected" href="#nowhere">商品详情</a>
<a class="productDetailTopReviewLink" href="#nowhere">累计评价 <span class="productDetailTopReviewLinkNumber">19</span> </a>
</div>
<div class="productParamterPart">
<div class="productParamter">产品参数:</div>
<div class="productParamterList">
<span>材质成分: 聚酯纤维100% </span>
<span>品牌: Emyche/艾米秋 </span>
<span>货号: 129668 </span>
<span>尺码: L M S XL X </span>
<span>上市年份季节: 2016年夏季 </span>
<span>颜色分类: 白色 黑色 浅蓝 </span>
<span>适用年龄: 18-25周岁 </span>
</div>
<div style="clear:both"></div>
</div>
<div class="productDetailImagesPart">
<img src="http://127.0.0.1/tmall/img/productDetail/8626.jpg">
</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.productDetailDiv{
width: 790px;
margin: 40px auto;
}
div.productDetailTopPart{
border: 1px solid #DFDFDF;
border-left-width: 0px;
}
a.selected{
border-left: 1px solid #cfbfb1;
border-right: 1px solid #cfbfb1;
color: #b10000;
display: inline-block;
font-weight: bold;
line-height: 46px;
width: 90px;
text-align: center;
position: relative;
}
a.selected:before{
content:"";
display: block;
border-width: 1px;
border-color: #b00000;
border-style: solid;
width: 90px;
height: 0;
position: absolute;
top: -1px;
margin-left: -1px;
}
a.selected:after{
content: "";
display: block;
border-color: #b00000 transparent transparent;
border-style: solid;
border-width: 5px;
width: 0;
height: 0;
position: absolute;
top: -1px;
left: 50%;
margin-left: -5px;
}
a.productDetailTopReviewLink{
padding: 0px 20px;
border-right: 1px dotted #D2D2D2;
color: #333333;
}
span.productDetailTopReviewLinkNumber{
color: #3355B9;
}
div.productParamterPart{
border: 1px solid #DFDFDF;
padding: 40px;
}
div.productParamter{
color: #999999;
font-weight: bold;
margin-bottom: 20px;
}
div.productParamterList span{
display: block;
width: 220px;
float: left;
padding: 8px 0px;
color: #666666;
}
div.productDetailImagesPart img{
display: block;
width: 790px;
margin:20px 0px;
}
body{
font-size: 12px;
font-family: Arial;
}
a:hover{
text-decoration:none;
color: #C40000;
}
</style>
<div class="productDetailDiv" style="display: block;">
<div class="productDetailTopPart">
<a class="productDetailTopPartSelectedLink selected" href="#nowhere">商品详情</a>
<a class="productDetailTopReviewLink" href="#nowhere">累计评价 <span class="productDetailTopReviewLinkNumber">19</span> </a>
</div>
<div class="productParamterPart">
<div class="productParamter">产品参数:</div>
<div class="productParamterList">
<span>材质成分: 聚酯纤维100% </span>
<span>品牌: Emyche/艾米秋 </span>
<span>货号: 129668 </span>
<span>尺码: L M S XL X </span>
<span>上市年份季节: 2016年夏季 </span>
<span>颜色分类: 白色 黑色 浅蓝 </span>
<span>适用年龄: 18-25周岁 </span>
</div>
<div style="clear:both"></div>
</div>
<div class="productDetailImagesPart">
<img src="http://127.0.0.1/tmall/img/productDetail/8626.jpg">
</div>
</div>
");
window.frames["iframe3241"].document.write(decodeHtml(code3241));
window.frames["iframe3241"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3241"]).load(function(){
$("#iframe3241").height($("#iframe3241").contents().find("body").height()+showittryitheight);
});
$("#iframe3241").height($("#iframe3241").contents().find("body").height()+showittryitheight);
alreadyWriteCode3241 = code3241;
$("#rendering3241").hide();
$("#rendered3241").show();
}
var tRereshRetry2DemoPanel3241 = setInterval(rereshRetry2DemoPanel3241,1000);
var binded3241 = false;
$("textarea#stepcodeTextarea3241").keyup(function(){
if(!binded3241){
$(window).bind('beforeunload',function(){
binded3241 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3241 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3241!=newCode){
// window.frames["iframe3241"].document.write("
");
// window.frames["iframe3241"].document.write(decodeHtml($("textarea#stepcodeTextarea3241").val()));
// window.frames["iframe3241"].document.close();
// $(window.frames["iframe3241"]).load(function(){
// $("#iframe3241").height($("#iframe3241").contents().find("body").height()+showittryitheight);
// });
// code3241 = newCode;
// }
});
$(".tryButton3241").click(function(){
$("#tryDiv3241").show();
$("#stepcodeTextarea3241").focus();
$("#stepcodeTextarea3241").height(200);
$("#iframe3241").height(0);
window.frames["iframe3241"].document.write("
");
window.frames["iframe3241"].document.write(decodeHtml($("textarea#stepcodeTextarea3241").val()));
window.frames["iframe3241"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3241"]).load(function(){
$("#iframe3241").height($("#iframe3241").contents().find("body").height()+showittryitheight);
});
$("#iframe3241").height($("#iframe3241").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3241.focus();
editor3241.setSize(null, "250");
$("#rendering3241").hide();
$("#rendered3241").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 editor3241 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3241"), {
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);
}
}
});
editor3241.on("change",function(doc){
if(!binded3241){
$(window).bind('beforeunload',function(){
binded3241 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3241 = newCode;
$("textarea#stepcodeTextarea3241").val(newCode);
if(alreadyWriteCode3241!=code3241){
lastModifedTime3241 = new Date().getTime();
$("#rendering3241").show();
$("#rendered3241").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3241 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3241.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3241").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|