|
步骤
1
:
效果
步骤
2
:
布局
步骤
3
:
纯html
步骤
4
:
加上样式
步骤
5
:
样式讲解
步骤
6
:
再整合在一起
");
window.frames["iframe_show3315"].document.write(decodeHtml($("textarea#stepcodeTextarea3315").val()));
window.frames["iframe_show3315"].document.close();
$(window.frames["iframe_show3315"]).load(function(){
$("#iframe_show3315").height($("#iframe_show3315").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3315").height($("#iframe_show3315").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.buyPageDiv{
margin: 20px auto;
max-width: 1013px;
}
div.addressTip, div.productListTip{
color: #333333;
font-size: 16px;
font-weight: bold;
text-align: left;
margin-bottom: 30px;
}
table.productListTable{
width: 100%;
border-collapse: separate;
font-size:12px;
}
table.productListTable th{
color: #999999;
font-family: 宋体;
font-weight: normal;
font-size: 12px;
text-align: center;
padding-bottom: 5px;
}
table.productListTable tr.rowborder td{
background-color: #b2d1ff;
border-right: 2px solid #fff;
height: 3px;
}
th.productListTableFirstColumn{
text-align: left !important;
}
img.tmallbuy{
width: 15px;
}
a.marketLink{
color: black;
font-size: 12px;
font-family: 宋体;
font-weight: normal;
}
a.marketLink:hover{
color: black;
font-size: 12px;
text-decoration: underline;
font-family: 宋体;
font-weight: normal;
}
span.wangwangGif{
display: inline-block;
width: 25px;
height: 25px;
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: -83px -0px;
position: relative;
top: 8px;
left: 2px;
}
tbody.productListTableTbody td{
text-align: center;
}
tbody.productListTableTbody td.orderItemFirstTD{
text-align: left;
}
tr.orderItemTR td{
border-bottom: 1px solid #E5E5E5;
}
tr.orderItemTR td{
padding: 10px 0px;
}
img.orderItemImg{
width: 50px;
height: 50px;
border: 1px solid #E9E9E9;
}
td.orderItemProductInfo{
text-align:left !important;
}
td.orderItemProductInfo img{
height: 16px;
}
a.orderItemProductLink{
color: #666666;
display: block;
}
a.orderItemProductLink:hover{
color: #666666;
text-decoration: underline;
}
span.orderItemProductPrice, span.orderItemProductNumber{
color: #000000;
}
span.orderItemUnitSum{
color: #CC0000;
font-weight: bold;
}
td.orderItemFirstTD, td.orderItemLastTD{
border-bottom: 0px solid black !important;
}
label.orderItemDeliveryLabel{
color: #666666;
font-family: 宋体;
font-size: 12px;
font-weight: normal;
}
select.orderItemDeliverySelect{
width: 100px;
height: 23px;
}
div.orderItemSumDiv{
padding: 20px;
border-top: 2px solid #B4D0FF;
background-color: #F2F6FF;
height: 50px;
}
div.orderItemSumDiv span{
color: #999999;
}
span.leaveMessageText{
display: inilne-block;
margin-right: 10px;
float: left;
}
div.orderItemTotalSumDiv{
margin: 40px;
height: 40px;
}
div.submitOrderDiv{
height: 40px;
margin: 20px 0px;
}
div.orderItemTotalSumDiv span{
color: #999999;
}
span.orderItemTotalSumSpan{
color: #C40000 !important;
font-size: 22px;
font-weight: bold;
border-bottom: 1px dotted #F2F6FF;
}
button.submitOrderButton{
border: 1px solid #C40000;
background-color: #C40000;
text-align: center;
line-height: 40px;
font-size: 14px;
font-weight: 700;
color: white;
float: right;
display:inline-block;
margin:0px 10px;
width:180px;
height: 40px;
}
body{
font-size: 12px;
font-family: Arial;
}
</style>
<div class="buyPageDiv">
<div class="productList">
<div class="productListTip">确认订单信息</div>
<table class="productListTable">
<thead>
<tr>
<th class="productListTableFirstColumn" colspan="2">
<img src="http://127.0.0.1/tmall../../../img/site/tmallbuy.png" class="tmallbuy">
<a href="#nowhere" class="marketLink">店铺:天猫店铺</a>
<a href="#nowhere" class="wangwanglink"> <span class="wangwangGif"></span> </a>
</th>
<th>单价</th>
<th>数量</th>
<th>小计</th>
<th>配送方式</th>
</tr>
<tr class="rowborder">
<td colspan="2"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tbody class="productListTableTbody">
<tr class="orderItemTR">
<td class="orderItemFirstTD"><img width="20px" src="http://127.0.0.1/tmall/img/productSingle_middle/4206.jpg" class="orderItemImg"></td>
<td class="orderItemProductInfo">
<a class="orderItemProductLink" href="#nowhere">
Philips/飞利浦 HR1897/30破壁微榨原汁机 多功能家用果汁榨汁机
</a>
<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">
</td>
<td>
<span class="orderItemProductPrice">¥3,514.05</span>
</td>
<td>
<span class="orderItemProductNumber">2</span>
</td>
<td><span class="orderItemUnitSum">
¥7,028.10
</span></td>
<td class="orderItemLastTD" rowspan="5">
<label class="orderItemDeliveryLabel">
<input type="radio" checked="checked" value="">
普通配送
</label>
<select class="orderItemDeliverySelect">
<option>快递 免邮费</option>
</select>
</td>
</tr>
<tr class="orderItemTR">
<td class="orderItemFirstTD"><img width="20px" src="http://127.0.0.1/tmall/img/productSingle_middle/3796.jpg" class="orderItemImg"></td>
<td class="orderItemProductInfo">
<a class="orderItemProductLink" href="#nowhere">
公众智能扫地机器人家用全自动电动清洁地毯擦拖地一体机吸尘器
</a>
<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">
</td>
<td>
<span class="orderItemProductPrice">¥2,124.15</span>
</td>
<td>
<span class="orderItemProductNumber">1</span>
</td>
<td><span class="orderItemUnitSum">
¥2,124.15
</span></td>
</tr>
</tbody>
</table>
<div class="orderItemSumDiv">
<div class="pull-left">
<span class="leaveMessageText">给卖家留言:</span>
<span>
<img src="http://127.0.0.1/tmall../../../img/site/leaveMessage.png" class="leaveMessageImg">
</span>
<span class="leaveMessageTextareaSpan" style="display: none;">
<textarea class="leaveMessageTextarea" name="userMessage"></textarea>
<div>
<span>还可以输入200个字符</span>
</div>
</span>
</div>
<span class="pull-right">店铺合计(含运费): ¥9,152.25</span>
</div>
</div>
<div class="orderItemTotalSumDiv">
<div class="pull-right">
<span>实付款:</span>
<span class="orderItemTotalSumSpan">¥9,152.25</span>
</div>
</div>
<div class="submitOrderDiv">
<button class="submitOrderButton" type="button">提交订单</button>
</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.buyPageDiv{
margin: 20px auto;
max-width: 1013px;
}
div.addressTip, div.productListTip{
color: #333333;
font-size: 16px;
font-weight: bold;
text-align: left;
margin-bottom: 30px;
}
table.productListTable{
width: 100%;
border-collapse: separate;
font-size:12px;
}
table.productListTable th{
color: #999999;
font-family: 宋体;
font-weight: normal;
font-size: 12px;
text-align: center;
padding-bottom: 5px;
}
table.productListTable tr.rowborder td{
background-color: #b2d1ff;
border-right: 2px solid #fff;
height: 3px;
}
th.productListTableFirstColumn{
text-align: left !important;
}
img.tmallbuy{
width: 15px;
}
a.marketLink{
color: black;
font-size: 12px;
font-family: 宋体;
font-weight: normal;
}
a.marketLink:hover{
color: black;
font-size: 12px;
text-decoration: underline;
font-family: 宋体;
font-weight: normal;
}
span.wangwangGif{
display: inline-block;
width: 25px;
height: 25px;
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: -83px -0px;
position: relative;
top: 8px;
left: 2px;
}
tbody.productListTableTbody td{
text-align: center;
}
tbody.productListTableTbody td.orderItemFirstTD{
text-align: left;
}
tr.orderItemTR td{
border-bottom: 1px solid #E5E5E5;
}
tr.orderItemTR td{
padding: 10px 0px;
}
img.orderItemImg{
width: 50px;
height: 50px;
border: 1px solid #E9E9E9;
}
td.orderItemProductInfo{
text-align:left !important;
}
td.orderItemProductInfo img{
height: 16px;
}
a.orderItemProductLink{
color: #666666;
display: block;
}
a.orderItemProductLink:hover{
color: #666666;
text-decoration: underline;
}
span.orderItemProductPrice, span.orderItemProductNumber{
color: #000000;
}
span.orderItemUnitSum{
color: #CC0000;
font-weight: bold;
}
td.orderItemFirstTD, td.orderItemLastTD{
border-bottom: 0px solid black !important;
}
label.orderItemDeliveryLabel{
color: #666666;
font-family: 宋体;
font-size: 12px;
font-weight: normal;
}
select.orderItemDeliverySelect{
width: 100px;
height: 23px;
}
div.orderItemSumDiv{
padding: 20px;
border-top: 2px solid #B4D0FF;
background-color: #F2F6FF;
height: 50px;
}
div.orderItemSumDiv span{
color: #999999;
}
span.leaveMessageText{
display: inilne-block;
margin-right: 10px;
float: left;
}
div.orderItemTotalSumDiv{
margin: 40px;
height: 40px;
}
div.submitOrderDiv{
height: 40px;
margin: 20px 0px;
}
div.orderItemTotalSumDiv span{
color: #999999;
}
span.orderItemTotalSumSpan{
color: #C40000 !important;
font-size: 22px;
font-weight: bold;
border-bottom: 1px dotted #F2F6FF;
}
button.submitOrderButton{
border: 1px solid #C40000;
background-color: #C40000;
text-align: center;
line-height: 40px;
font-size: 14px;
font-weight: 700;
color: white;
float: right;
display:inline-block;
margin:0px 10px;
width:180px;
height: 40px;
}
body{
font-size: 12px;
font-family: Arial;
}
</style>
<div class="buyPageDiv">
<div class="productList">
<div class="productListTip">确认订单信息</div>
<table class="productListTable">
<thead>
<tr>
<th class="productListTableFirstColumn" colspan="2">
<img src="http://127.0.0.1/tmall../../../img/site/tmallbuy.png" class="tmallbuy">
<a href="#nowhere" class="marketLink">店铺:天猫店铺</a>
<a href="#nowhere" class="wangwanglink"> <span class="wangwangGif"></span> </a>
</th>
<th>单价</th>
<th>数量</th>
<th>小计</th>
<th>配送方式</th>
</tr>
<tr class="rowborder">
<td colspan="2"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tbody class="productListTableTbody">
<tr class="orderItemTR">
<td class="orderItemFirstTD"><img width="20px" src="http://127.0.0.1/tmall/img/productSingle_middle/4206.jpg" class="orderItemImg"></td>
<td class="orderItemProductInfo">
<a class="orderItemProductLink" href="#nowhere">
Philips/飞利浦 HR1897/30破壁微榨原汁机 多功能家用果汁榨汁机
</a>
<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">
</td>
<td>
<span class="orderItemProductPrice">¥3,514.05</span>
</td>
<td>
<span class="orderItemProductNumber">2</span>
</td>
<td><span class="orderItemUnitSum">
¥7,028.10
</span></td>
<td class="orderItemLastTD" rowspan="5">
<label class="orderItemDeliveryLabel">
<input type="radio" checked="checked" value="">
普通配送
</label>
<select class="orderItemDeliverySelect">
<option>快递 免邮费</option>
</select>
</td>
</tr>
<tr class="orderItemTR">
<td class="orderItemFirstTD"><img width="20px" src="http://127.0.0.1/tmall/img/productSingle_middle/3796.jpg" class="orderItemImg"></td>
<td class="orderItemProductInfo">
<a class="orderItemProductLink" href="#nowhere">
公众智能扫地机器人家用全自动电动清洁地毯擦拖地一体机吸尘器
</a>
<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">
</td>
<td>
<span class="orderItemProductPrice">¥2,124.15</span>
</td>
<td>
<span class="orderItemProductNumber">1</span>
</td>
<td><span class="orderItemUnitSum">
¥2,124.15
</span></td>
</tr>
</tbody>
</table>
<div class="orderItemSumDiv">
<div class="pull-left">
<span class="leaveMessageText">给卖家留言:</span>
<span>
<img src="http://127.0.0.1/tmall../../../img/site/leaveMessage.png" class="leaveMessageImg">
</span>
<span class="leaveMessageTextareaSpan" style="display: none;">
<textarea class="leaveMessageTextarea" name="userMessage"></textarea>
<div>
<span>还可以输入200个字符</span>
</div>
</span>
</div>
<span class="pull-right">店铺合计(含运费): ¥9,152.25</span>
</div>
</div>
<div class="orderItemTotalSumDiv">
<div class="pull-right">
<span>实付款:</span>
<span class="orderItemTotalSumSpan">¥9,152.25</span>
</div>
</div>
<div class="submitOrderDiv">
<button class="submitOrderButton" type="button">提交订单</button>
</div>
</div>
");
window.frames["iframe3315"].document.write(decodeHtml(code3315));
window.frames["iframe3315"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3315"]).load(function(){
$("#iframe3315").height($("#iframe3315").contents().find("body").height()+showittryitheight);
});
$("#iframe3315").height($("#iframe3315").contents().find("body").height()+showittryitheight);
alreadyWriteCode3315 = code3315;
$("#rendering3315").hide();
$("#rendered3315").show();
}
var tRereshRetry2DemoPanel3315 = setInterval(rereshRetry2DemoPanel3315,1000);
var binded3315 = false;
$("textarea#stepcodeTextarea3315").keyup(function(){
if(!binded3315){
$(window).bind('beforeunload',function(){
binded3315 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3315 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3315!=newCode){
// window.frames["iframe3315"].document.write("
");
// window.frames["iframe3315"].document.write(decodeHtml($("textarea#stepcodeTextarea3315").val()));
// window.frames["iframe3315"].document.close();
// $(window.frames["iframe3315"]).load(function(){
// $("#iframe3315").height($("#iframe3315").contents().find("body").height()+showittryitheight);
// });
// code3315 = newCode;
// }
});
$(".tryButton3315").click(function(){
$("#tryDiv3315").show();
$("#stepcodeTextarea3315").focus();
$("#stepcodeTextarea3315").height(200);
$("#iframe3315").height(0);
window.frames["iframe3315"].document.write("
");
window.frames["iframe3315"].document.write(decodeHtml($("textarea#stepcodeTextarea3315").val()));
window.frames["iframe3315"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3315"]).load(function(){
$("#iframe3315").height($("#iframe3315").contents().find("body").height()+showittryitheight);
});
$("#iframe3315").height($("#iframe3315").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3315.focus();
editor3315.setSize(null, "250");
$("#rendering3315").hide();
$("#rendered3315").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 editor3315 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3315"), {
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);
}
}
});
editor3315.on("change",function(doc){
if(!binded3315){
$(window).bind('beforeunload',function(){
binded3315 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3315 = newCode;
$("textarea#stepcodeTextarea3315").val(newCode);
if(alreadyWriteCode3315!=code3315){
lastModifedTime3315 = new Date().getTime();
$("#rendering3315").show();
$("#rendered3315").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3315 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3315.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3315").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
增值内容,请先登录
增值内容,请先登录
增值内容,请先登录
增值内容,请先登录
增值内容,请先登录
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|