最近遇到的几个问题

    xiaoxiao2022-06-28  38

    1、z-index和transform一起使用的时候会出现的情况:z-index的层高永远都比使用了transform的元素的层高低。想要层级至高,同样需要使用transform来改变z轴的值

    2、从下面的字符串中获取crowdFundingId的值

    http://local.sapi.51baoku.com/mobile/html/crowd_detail.html?crowdFundingId=1473143501&from=WechatSession

    getQueryString(‘crowdFundingId’);

    function getQueryString(name) {         var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");         var r = window.location.search.substr(1).match(reg);         if (r != null) return unescape(r[2]);         return null;     }

    3、解决动态创建的动态样式的问题

        for(var len=arry1.length,i=0;i<len;i++){          str1.push('<li style="left: calc(('+(len-i)+')*0.3rem);">\              <img src="http://img.51baoku.com/pic/75090/0"/>\          </li>'             );         }

    4、图片尺寸大于屏幕宽度的时候

          使用背景图,保证不管屏幕多大图片都是居中的

    .section-top {

    width:100%;

    height:250px;

    background: url(../img/Talent-recruitment-.png)no-repeat center center;

    overflow:hidden;

    }

    .section-top ul{

      margin:0 auto;

      width:1100px;

      height:50px;

      margin-top:200px;

    }

    转载请注明原文地址: https://ju.6miu.com/read-1124420.html

    最新回复(0)