hiki1987
Follow

After following, you can keep track of his dynamic information in a timely manner

Course notes
  • Courses in the relevant section:List multi-condition filtering

    <li <?php if(!in_array($data['label_channel'],array_keys($channel_list))){echo 'class="selected"';}?>> <a href="/index.php/index/index/cate?label_channel=0&label_charge={$data.label_charge}&label_area={$data.label_area}">全部</a> </li> {volist name="channel_list" id="channel"} <li {if condition="$data.label_channel eq $channel.id"}class="selected"{/if}> <a href="/index.php/index/index/cate?label_channel={$channel.id}&label_charge={$data.label_charge}&label_area={$data.label_area}">{$channel.title}</a> </li> {/volist} 频道列表有点BUG,老师没做,上面是做好的

    2018-09-172个赞

  • Courses in the relevant section:html basics

    块级元素独占一行,可以设置宽高、默认浏览器高度、有行间距。行内元素可以多个并行、靠内容撑开,不可以设置宽高

    2018-12-110个赞

  • Courses in the relevant section:Common tags and attributes in HTML (list)

    ul li{list-style:url(img/huangguan.png);} 列表前面插入一个图片 ul li{list-style-type: none;不显示排序前面的圆点或数字 height: 40px;width: 400px; border:1px solid #ccc; 边框 margin:5px 0px;text-align: center;line-height: 20px;} ul li:before{content: url(img/huangguan.png);margin-right: 10px;} 前面插入图片 ​ul li:after{content: url(img/huangguan.png);}右边插入图片

    2018-12-110个赞

  • Courses in the relevant section:Positioning in CSS

    13课 CSS的定位-相对定位和绝对定位 绝对定位要相对于父级元素,否则就会默认定位 给行内元素一个绝对定位后,它就会变成一个块级框,就不用给他display: block;来转成块级元素了。 通常在做绝对定位时,会给它的父级设置相对定位。 一般情况是结合使用,也可单独使用,单独使用时绝对元素是找body的属性。 它们是相对于水平或者垂直方向进行位移。 position: relative; 设置相对定位 position: absolute;设置绝对定位

    2018-12-110个赞

  • Courses in the relevant section:Realize the addition and subtraction of the quantity of items in the shopping cart and the subtotal of the total price of the items

    //加减按钮 // siblings('input').val() 用于匹配input框里的val属性 $('.plus').click(function(){ var nowvalue=$(this).siblings('input').val() var nowvalue=parseInt(nowvalue) //把input框里的文本类型转换成整数parseInt // var currentvalue=0 //做下清零,加号这里可以不用,减号那里必须有 var currentvalue=nowvalue+1 $(this).siblings('input').val(currentvalue) // 前台单价的里面是3199元,有个中文,用parseFloat()方法只取数字 /*parents() 获得当前匹配元素集合中每个元素的祖先元素,这里是获取good-num的 祖先元素下的good-price里的html值*/ var danjia=parseFloat($(this).parents('.good-num').siblings('.good-price').html()) var xiaoji=danjia*currentvalue //在页面中输出 $(this).parents('.good-num').siblings('.good-total-price').html(xiaoji+'元') }) $('.minus').click(function(){ var nowvalue=$(this).siblings('input').val() var nowvalue=parseInt(nowvalue) //把input框里的文本类型转换成整数parseInt var currentvalue=0 //做下清零,加号这里可以不用,减号那里必须有 /*三元运算符(nowvalue<=1?)小于等于1就设置为1(?currentvalue=1) 否则:currentvalue=nowvalue-1 (nowvalue可以减-1)*/ nowvalue<=1?currentvalue=1:currentvalue=nowvalue-1 $(this).siblings('input').val(currentvalue) var danjia=parseFloat($(this).parents('.good-num').siblings('.good-price').html()) var xiaoji=danjia*currentvalue //在页面中输出 $(this).parents('.good-num').siblings('.good-total-price').html(xiaoji+'元') })

    2018-12-261个赞