|
步骤
1
:
效果
步骤
2
:
布局
步骤
3
:
纯html
步骤
4
:
加上样式
步骤
5
:
样式讲解
步骤
6
:
再整合在一起
");
window.frames["iframe_show3294"].document.write(decodeHtml($("textarea#stepcodeTextarea3294").val()));
window.frames["iframe_show3294"].document.close();
$(window.frames["iframe_show3294"]).load(function(){
$("#iframe_show3294").height($("#iframe_show3294").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3294").height($("#iframe_show3294").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.boughtDiv{
max-width: 1013px;
margin: 10px auto;
}
table.orderListItemTable{
border: 2px solid #ECECEC;
width: 100%;
margin: 20px 0px;
font-size:12px;
}
table.orderListItemTable:hover{
border: 2px solid #aaa !important;
}
table.orderListItemTable td{
padding: 8px 10px;
}
tr.orderListItemFirstTR{
background-color: #F1F1F1;
}
div.orderItemWangWangGif{
display: inline-block;
width: 67px;
height: 22px;
background-image:url(http://127.0.0.1/tmall../../../img/site/wangwang.gif);
background-repeat: no-repeat;
background-color: transparent;
background-attachment: scroll;
background-position: -0px -0px;
position: relative;
top: 0px;
left: 2px;
}
td.orderItemDeleteTD{
text-align: right;
}
span.orderListItemDelete{
display: inline-block;
margin: 0px 10px;
color: #999999;
font-size: 16px;
}
div.orderListItemProductLinkOutDiv{
position: relative;
height: 80px;
}
div.orderListItemProductLinkInnerDiv{
position: absolute;
bottom: 0px;
}
div.orderListItemProductOriginalPrice{
color: #999999;
font-size: 14px;
}
div.orderListItemProductPrice{
color: #3C3C3C;
font-size: 14px;
}
td.orderListItemNumberTD{
text-align: center;
}
td.orderItemOrderInfoPartTD{
border: solid 1px #ECECEC;
}
span.orderListItemNumber{
color: #3C3C3C;
}
td.orderListItemProductRealPriceTD{
text-align: center;
}
div.orderListItemProductRealPrice{
color: #3C3C3C;
font-size: 14px;
font-weight: bold;
}
div.orderListItemPriceWithTransport{
color: #6C6C6C;
font-size: 12px;
}
td.orderListItemButtonTD{
text-align: center;
}
button.orderListItemReview{
border: 1px solid #DCDCDC;
background-color: #fff;
border-radius: 2px;
color: #3C3C3C;
font-size: 12px;
font-weight: bold;
padding: 6px 12px;
}
button.orderListItemReview:hover{
border-color: #C40000;
color: #C40000;
}
button.orderListItemConfirm{
background-color: #66B6FF;
border-radius: 2px;
color: white;
font-size: 12px;
font-weight: bold;
border-width: 0px;
padding: 6px 12px;
}
button.orderListItemConfirm:hover{
background-color: #118ADB;
}
a{
color:#999;
}
a:hover{
text-decoration:none;
color: #C40000;
}
</style>
<div class="boughtDiv">
<div class="orderListItem">
<table oid="946" orderstatus="waitReview" class="orderListItemTable">
<tbody><tr class="orderListItemFirstTR">
<td colspan="2">
<b>2016-09-12 17:00:41</b>
<span>订单号: 20160912170041674794
</span>
</td>
<td colspan="2"><img width="13px" src="http://127.0.0.1/tmall../../../img/site/orderItemTmall.png">天猫商场</td>
<td colspan="1">
<a href="#nowhere" class="wangwanglink">
<div class="orderItemWangWangGif"></div>
</a>
</td>
<td class="orderItemDeleteTD">
<a href="#nowhere" oid="946" class="deleteOrderLink">
<span class="orderListItemDelete glyphicon glyphicon-trash"></span>
</a>
</td>
</tr>
<tr class="orderItemProductInfoPartTR">
<td class="orderItemProductInfoPartTD"><img width="80" height="80" src="http://127.0.0.1/tmall/img/productSingle_middle/3796.jpg"></td>
<td class="orderItemProductInfoPartTD">
<div class="orderListItemProductLinkOutDiv">
<a href="#nowhere">公众智能扫地机器人家用全自动电动清洁地毯擦拖地一体机吸尘器</a>
<div class="orderListItemProductLinkInnerDiv">
<img title="支持信用卡支付" src="http://127.0.0.1/tmall../../../img/site/creditcard.png">
<img title="消费者保障服务,承诺7天退货" src="http://127.0.0.1/tmall../../../img/site/7day.png">
<img title="消费者保障服务,承诺如实描述" src="http://127.0.0.1/tmall../../../img/site/promise.png">
</div>
</div>
</td>
<td width="100px" class="orderItemProductInfoPartTD">
<div class="orderListItemProductOriginalPrice">¥2,499.00</div>
<div class="orderListItemProductPrice">¥2,124.15</div>
</td>
<td width="100px" valign="top" class="orderListItemNumberTD orderItemOrderInfoPartTD" rowspan="1">
<span class="orderListItemNumber">1</span>
</td>
<td width="120px" valign="top" class="orderListItemProductRealPriceTD orderItemOrderInfoPartTD" rowspan="1">
<div class="orderListItemProductRealPrice">¥2,124.15</div>
<div class="orderListItemPriceWithTransport">(含运费:¥0.00)</div>
</td>
<td width="100px" valign="top" class="orderListItemButtonTD orderItemOrderInfoPartTD" rowspan="1">
<a href="#nowhere">
<button class="orderListItemReview">评价</button>
</a>
</td>
</tr>
</tbody></table>
<table oid="945" orderstatus="waitConfirm" class="orderListItemTable">
<tbody><tr class="orderListItemFirstTR">
<td colspan="2">
<b>2016-09-12 17:00:33</b>
<span>订单号: 201609121700333128784
</span>
</td>
<td colspan="2"><img width="13px" src="http://127.0.0.1/tmall../../../img/site/orderItemTmall.png">天猫商场</td>
<td colspan="1">
<a href="#nowhere" class="wangwanglink">
<div class="orderItemWangWangGif"></div>
</a>
</td>
<td class="orderItemDeleteTD">
<a href="#nowhere" oid="945" class="deleteOrderLink">
<span class="orderListItemDelete glyphicon glyphicon-trash"></span>
</a>
</td>
</tr>
<tr class="orderItemProductInfoPartTR">
<td class="orderItemProductInfoPartTD"><img width="80" height="80" src="http://127.0.0.1/tmall/img/productSingle_middle/6651.jpg"></td>
<td class="orderItemProductInfoPartTD">
<div class="orderListItemProductLinkOutDiv">
<a href="#nowhere">ULIFE原创信封包男个性真皮手包男士手拿包休闲男包手抓包拉链潮</a>
<div class="orderListItemProductLinkInnerDiv">
<img title="支持信用卡支付" src="http://127.0.0.1/tmall../../../img/site/creditcard.png">
<img title="消费者保障服务,承诺7天退货" src="http://127.0.0.1/tmall../../../img/site/7day.png">
<img title="消费者保障服务,承诺如实描述" src="http://127.0.0.1/tmall../../../img/site/promise.png">
</div>
</div>
</td>
<td width="100px" class="orderItemProductInfoPartTD">
<div class="orderListItemProductOriginalPrice">¥1,188.00</div>
<div class="orderListItemProductPrice">¥1,128.60</div>
</td>
<td width="100px" valign="top" class="orderListItemNumberTD orderItemOrderInfoPartTD" rowspan="1">
<span class="orderListItemNumber">1</span>
</td>
<td width="120px" valign="top" class="orderListItemProductRealPriceTD orderItemOrderInfoPartTD" rowspan="1">
<div class="orderListItemProductRealPrice">¥1,128.60</div>
<div class="orderListItemPriceWithTransport">(含运费:¥0.00)</div>
</td>
<td width="100px" valign="top" class="orderListItemButtonTD orderItemOrderInfoPartTD" rowspan="1">
<a href="#nowhere">
<button class="orderListItemConfirm">确认收货</button>
</a>
</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.boughtDiv{
max-width: 1013px;
margin: 10px auto;
}
table.orderListItemTable{
border: 2px solid #ECECEC;
width: 100%;
margin: 20px 0px;
font-size:12px;
}
table.orderListItemTable:hover{
border: 2px solid #aaa !important;
}
table.orderListItemTable td{
padding: 8px 10px;
}
tr.orderListItemFirstTR{
background-color: #F1F1F1;
}
div.orderItemWangWangGif{
display: inline-block;
width: 67px;
height: 22px;
background-image:url(http://127.0.0.1/tmall../../../img/site/wangwang.gif);
background-repeat: no-repeat;
background-color: transparent;
background-attachment: scroll;
background-position: -0px -0px;
position: relative;
top: 0px;
left: 2px;
}
td.orderItemDeleteTD{
text-align: right;
}
span.orderListItemDelete{
display: inline-block;
margin: 0px 10px;
color: #999999;
font-size: 16px;
}
div.orderListItemProductLinkOutDiv{
position: relative;
height: 80px;
}
div.orderListItemProductLinkInnerDiv{
position: absolute;
bottom: 0px;
}
div.orderListItemProductOriginalPrice{
color: #999999;
font-size: 14px;
}
div.orderListItemProductPrice{
color: #3C3C3C;
font-size: 14px;
}
td.orderListItemNumberTD{
text-align: center;
}
td.orderItemOrderInfoPartTD{
border: solid 1px #ECECEC;
}
span.orderListItemNumber{
color: #3C3C3C;
}
td.orderListItemProductRealPriceTD{
text-align: center;
}
div.orderListItemProductRealPrice{
color: #3C3C3C;
font-size: 14px;
font-weight: bold;
}
div.orderListItemPriceWithTransport{
color: #6C6C6C;
font-size: 12px;
}
td.orderListItemButtonTD{
text-align: center;
}
button.orderListItemReview{
border: 1px solid #DCDCDC;
background-color: #fff;
border-radius: 2px;
color: #3C3C3C;
font-size: 12px;
font-weight: bold;
padding: 6px 12px;
}
button.orderListItemReview:hover{
border-color: #C40000;
color: #C40000;
}
button.orderListItemConfirm{
background-color: #66B6FF;
border-radius: 2px;
color: white;
font-size: 12px;
font-weight: bold;
border-width: 0px;
padding: 6px 12px;
}
button.orderListItemConfirm:hover{
background-color: #118ADB;
}
a{
color:#999;
}
a:hover{
text-decoration:none;
color: #C40000;
}
</style>
<div class="boughtDiv">
<div class="orderListItem">
<table oid="946" orderstatus="waitReview" class="orderListItemTable">
<tbody><tr class="orderListItemFirstTR">
<td colspan="2">
<b>2016-09-12 17:00:41</b>
<span>订单号: 20160912170041674794
</span>
</td>
<td colspan="2"><img width="13px" src="http://127.0.0.1/tmall../../../img/site/orderItemTmall.png">天猫商场</td>
<td colspan="1">
<a href="#nowhere" class="wangwanglink">
<div class="orderItemWangWangGif"></div>
</a>
</td>
<td class="orderItemDeleteTD">
<a href="#nowhere" oid="946" class="deleteOrderLink">
<span class="orderListItemDelete glyphicon glyphicon-trash"></span>
</a>
</td>
</tr>
<tr class="orderItemProductInfoPartTR">
<td class="orderItemProductInfoPartTD"><img width="80" height="80" src="http://127.0.0.1/tmall/img/productSingle_middle/3796.jpg"></td>
<td class="orderItemProductInfoPartTD">
<div class="orderListItemProductLinkOutDiv">
<a href="#nowhere">公众智能扫地机器人家用全自动电动清洁地毯擦拖地一体机吸尘器</a>
<div class="orderListItemProductLinkInnerDiv">
<img title="支持信用卡支付" src="http://127.0.0.1/tmall../../../img/site/creditcard.png">
<img title="消费者保障服务,承诺7天退货" src="http://127.0.0.1/tmall../../../img/site/7day.png">
<img title="消费者保障服务,承诺如实描述" src="http://127.0.0.1/tmall../../../img/site/promise.png">
</div>
</div>
</td>
<td width="100px" class="orderItemProductInfoPartTD">
<div class="orderListItemProductOriginalPrice">¥2,499.00</div>
<div class="orderListItemProductPrice">¥2,124.15</div>
</td>
<td width="100px" valign="top" class="orderListItemNumberTD orderItemOrderInfoPartTD" rowspan="1">
<span class="orderListItemNumber">1</span>
</td>
<td width="120px" valign="top" class="orderListItemProductRealPriceTD orderItemOrderInfoPartTD" rowspan="1">
<div class="orderListItemProductRealPrice">¥2,124.15</div>
<div class="orderListItemPriceWithTransport">(含运费:¥0.00)</div>
</td>
<td width="100px" valign="top" class="orderListItemButtonTD orderItemOrderInfoPartTD" rowspan="1">
<a href="#nowhere">
<button class="orderListItemReview">评价</button>
</a>
</td>
</tr>
</tbody></table>
<table oid="945" orderstatus="waitConfirm" class="orderListItemTable">
<tbody><tr class="orderListItemFirstTR">
<td colspan="2">
<b>2016-09-12 17:00:33</b>
<span>订单号: 201609121700333128784
</span>
</td>
<td colspan="2"><img width="13px" src="http://127.0.0.1/tmall../../../img/site/orderItemTmall.png">天猫商场</td>
<td colspan="1">
<a href="#nowhere" class="wangwanglink">
<div class="orderItemWangWangGif"></div>
</a>
</td>
<td class="orderItemDeleteTD">
<a href="#nowhere" oid="945" class="deleteOrderLink">
<span class="orderListItemDelete glyphicon glyphicon-trash"></span>
</a>
</td>
</tr>
<tr class="orderItemProductInfoPartTR">
<td class="orderItemProductInfoPartTD"><img width="80" height="80" src="http://127.0.0.1/tmall/img/productSingle_middle/6651.jpg"></td>
<td class="orderItemProductInfoPartTD">
<div class="orderListItemProductLinkOutDiv">
<a href="#nowhere">ULIFE原创信封包男个性真皮手包男士手拿包休闲男包手抓包拉链潮</a>
<div class="orderListItemProductLinkInnerDiv">
<img title="支持信用卡支付" src="http://127.0.0.1/tmall../../../img/site/creditcard.png">
<img title="消费者保障服务,承诺7天退货" src="http://127.0.0.1/tmall../../../img/site/7day.png">
<img title="消费者保障服务,承诺如实描述" src="http://127.0.0.1/tmall../../../img/site/promise.png">
</div>
</div>
</td>
<td width="100px" class="orderItemProductInfoPartTD">
<div class="orderListItemProductOriginalPrice">¥1,188.00</div>
<div class="orderListItemProductPrice">¥1,128.60</div>
</td>
<td width="100px" valign="top" class="orderListItemNumberTD orderItemOrderInfoPartTD" rowspan="1">
<span class="orderListItemNumber">1</span>
</td>
<td width="120px" valign="top" class="orderListItemProductRealPriceTD orderItemOrderInfoPartTD" rowspan="1">
<div class="orderListItemProductRealPrice">¥1,128.60</div>
<div class="orderListItemPriceWithTransport">(含运费:¥0.00)</div>
</td>
<td width="100px" valign="top" class="orderListItemButtonTD orderItemOrderInfoPartTD" rowspan="1">
<a href="#nowhere">
<button class="orderListItemConfirm">确认收货</button>
</a>
</td>
</tr>
</tbody></table>
</div>
</div>
");
window.frames["iframe3294"].document.write(decodeHtml(code3294));
window.frames["iframe3294"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3294"]).load(function(){
$("#iframe3294").height($("#iframe3294").contents().find("body").height()+showittryitheight);
});
$("#iframe3294").height($("#iframe3294").contents().find("body").height()+showittryitheight);
alreadyWriteCode3294 = code3294;
$("#rendering3294").hide();
$("#rendered3294").show();
}
var tRereshRetry2DemoPanel3294 = setInterval(rereshRetry2DemoPanel3294,1000);
var binded3294 = false;
$("textarea#stepcodeTextarea3294").keyup(function(){
if(!binded3294){
$(window).bind('beforeunload',function(){
binded3294 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3294 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3294!=newCode){
// window.frames["iframe3294"].document.write("
");
// window.frames["iframe3294"].document.write(decodeHtml($("textarea#stepcodeTextarea3294").val()));
// window.frames["iframe3294"].document.close();
// $(window.frames["iframe3294"]).load(function(){
// $("#iframe3294").height($("#iframe3294").contents().find("body").height()+showittryitheight);
// });
// code3294 = newCode;
// }
});
$(".tryButton3294").click(function(){
$("#tryDiv3294").show();
$("#stepcodeTextarea3294").focus();
$("#stepcodeTextarea3294").height(200);
$("#iframe3294").height(0);
window.frames["iframe3294"].document.write("
");
window.frames["iframe3294"].document.write(decodeHtml($("textarea#stepcodeTextarea3294").val()));
window.frames["iframe3294"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3294"]).load(function(){
$("#iframe3294").height($("#iframe3294").contents().find("body").height()+showittryitheight);
});
$("#iframe3294").height($("#iframe3294").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3294.focus();
editor3294.setSize(null, "250");
$("#rendering3294").hide();
$("#rendered3294").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 editor3294 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3294"), {
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);
}
}
});
editor3294.on("change",function(doc){
if(!binded3294){
$(window).bind('beforeunload',function(){
binded3294 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3294 = newCode;
$("textarea#stepcodeTextarea3294").val(newCode);
if(alreadyWriteCode3294!=code3294){
lastModifedTime3294 = new Date().getTime();
$("#rendering3294").show();
$("#rendered3294").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3294 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3294.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3294").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
增值内容,请先登录
增值内容,请先登录
增值内容,请先登录
增值内容,请先登录
增值内容,请先登录
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|