how2j.cn

步骤 1 : 效果   
步骤 2 : 布局   
步骤 3 : 纯html   
步骤 4 : 加上样式   
步骤 5 : 样式讲解   
步骤 6 : 再整合在一起   

步骤 1 :

效果

"); window.frames["iframe_show3341"].document.write(decodeHtml($("textarea#stepcodeTextarea3341").val())); window.frames["iframe_show3341"].document.close(); $(window.frames["iframe_show3341"]).load(function(){ $("#iframe_show3341").height($("#iframe_show3341").contents().find("body").height()+showittryitheight); }); $("#iframe_show3341").height($("#iframe_show3341").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.reviewDiv{ max-width: 1013px; margin: 10px auto; } div.reviewProductInfoImg{ border: 1px solid #E7E7E7; width: 464px; text-align: center; float: left; } div.reviewProductInfoRightDiv{ overflow: hidden; border-top: 1px solid #E7E7E7; padding: 30px 20px; } div.reviewProductInfoRightText{ color: black; font-size: 16px; font-weight: bold; } table.reviewProductInfoTable{ margin: 20px 10px; font-size:12px; } table.reviewProductInfoTable td{ padding-bottom: 5px; color: #999999; } span.reviewProductInfoTablePrice{ color: #C40000; font-size: 20px; font-weight: bold; } span.reviewProductInfoTableSellNumber{ color: #C40000; font-size: 14px; font-weight: bold; } div.reviewProductInfoRightBelowDiv{ border: 1px solid #F6F5F3; background-color: #FDFBFA; height: 166px; padding:16px 0px 16px 81px; } span.reviewProductInfoRightBelowImg{ background-color: white; border: 1px solid #E1E1E1; display: inline-block; width: 23px; height: 42px; background-image:url(http://127.0.0.1/tmall../../../img/site/reviewLight.png); background-repeat: no-repeat; padding: 0px; } span.reviewProductInfoRightBelowText{ border: 1px solid #EFEFEF; display: inline-block; width: 200px; height: 42px; padding: 4px; position: relative; left: -4px; top: -7px; color: #666666; font-size:12px; } img.reviewProductImg{ width:400px; height:400px; } </style> <div class="reviewDiv"> <div class="reviewProductInfoDiv"> <div class="reviewProductInfoImg"><img class="reviewProductImg" width="100px" height="100px" src="http://127.0.0.1/tmall/img/productSingle/8697.jpg"></div> <div class="reviewProductInfoRightDiv"> <div class="reviewProductInfoRightText"> 2016夏季新款女装雪纺衫短裤两件套 韩版时尚名媛休闲套装女夏装 </div> <table class="reviewProductInfoTable"> <tbody><tr> <td width="75px">价格:</td> <td><span class="reviewProductInfoTablePrice">¥263.00</span> 元 </td> </tr> <tr> <td>配送</td> <td>快递: 0.00</td> </tr> <tr> <td>月销量:</td> <td><span class="reviewProductInfoTableSellNumber">50</span> 件</td> </tr> </tbody></table> <div class="reviewProductInfoRightBelowDiv"> <span class="reviewProductInfoRightBelowImg"><img1 src="http://127.0.0.1/tmall../../../img/site/reviewLight.png"></img1></span> <span class="reviewProductInfoRightBelowText">现在查看的是 您所购买商品的信息 于2016年09月12下单购买了此商品 </span> </div> </div> <div style="clear:both"></div> </div> </div>
"); window.frames["iframe3341"].document.write(decodeHtml(code3341)); window.frames["iframe3341"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe3341"]).load(function(){ $("#iframe3341").height($("#iframe3341").contents().find("body").height()+showittryitheight); }); $("#iframe3341").height($("#iframe3341").contents().find("body").height()+showittryitheight); alreadyWriteCode3341 = code3341; $("#rendering3341").hide(); $("#rendered3341").show(); } var tRereshRetry2DemoPanel3341 = setInterval(rereshRetry2DemoPanel3341,1000); var binded3341 = false; $("textarea#stepcodeTextarea3341").keyup(function(){ if(!binded3341){ $(window).bind('beforeunload',function(){ binded3341 = true; return "xxxx"; }); } var newCode = $(this).val() code3341 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code3341!=newCode){ // window.frames["iframe3341"].document.write("
"); // window.frames["iframe3341"].document.write(decodeHtml($("textarea#stepcodeTextarea3341").val())); // window.frames["iframe3341"].document.close(); // $(window.frames["iframe3341"]).load(function(){ // $("#iframe3341").height($("#iframe3341").contents().find("body").height()+showittryitheight); // }); // code3341 = newCode; // } }); $(".tryButton3341").click(function(){ $("#tryDiv3341").show(); $("#stepcodeTextarea3341").focus(); $("#stepcodeTextarea3341").height(200); $("#iframe3341").height(0); window.frames["iframe3341"].document.write("
"); window.frames["iframe3341"].document.write(decodeHtml($("textarea#stepcodeTextarea3341").val())); window.frames["iframe3341"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe3341"]).load(function(){ $("#iframe3341").height($("#iframe3341").contents().find("body").height()+showittryitheight); }); $("#iframe3341").height($("#iframe3341").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor3341.focus(); editor3341.setSize(null, "250"); $("#rendering3341").hide(); $("#rendered3341").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 editor3341 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3341"), { 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); } } }); editor3341.on("change",function(doc){ if(!binded3341){ $(window).bind('beforeunload',function(){ binded3341 = true; return "xxxx"; }); } var newCode = doc.getValue(); code3341 = newCode; $("textarea#stepcodeTextarea3341").val(newCode); if(alreadyWriteCode3341!=code3341){ lastModifedTime3341 = new Date().getTime(); $("#rendering3341").show(); $("#rendered3341").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor3341 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor3341.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv3341").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
步骤 2 :

布局

增值内容,请先登录
步骤 3 :

纯html

增值内容,请先登录
步骤 4 :

加上样式

增值内容,请先登录
步骤 5 :

样式讲解

增值内容,请先登录
步骤 6 :

再整合在一起

增值内容,请先登录


HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。


关于 实践项目-天猫前端-评价页面上 的提问

尽量提供截图代码异常信息,有助于分析和解决问题。 也可进本站QQ群交流: 620943819
提问尽量提供完整的代码,环境描述,越是有利于问题的重现,您的问题越能更快得到解答。
对教程中代码有疑问,请提供是哪个步骤,哪一行有疑问,这样便于快速定位问题,提高问题得到解答的速度
在已经存在的几千个提问里,有相当大的比例,是因为使用了和站长不同版本的开发环境导致的,比如 jdk, eclpise, idea, mysql,tomcat 等等软件的版本不一致。
请使用和站长一样的版本,可以节约自己大量的学习时间。 站长把教学中用的软件版本整理了,都统一放在了这里, 方便大家下载: http://how2j.cn/k/helloworld/helloworld-version/1718.html

上传截图