• marquee标签广告轮播内容显示不全问题


    marquee标签内不能用 ul  li ,要用table tr td  才可以

    <template>
       <div class="v-marquee-info">
        <!--滚动信息-->
        <div class="marquee-info-content"> 
      // 错误的 
    <!-- <marquee style=" 100%; height:60px;" 
             scrollamount="10" scrolldelay="0" direction="left" 
              behaviour="Scroll" >
              <ul class="marquee-info" > 
                <li class="marquee-item" v-for="(item,index) in info_List"  :key="item.index" @click='showDetail(index)'>
                  {{ item.title }} 
                </li> 
              </ul> 
            </marquee> -->
            <marquee style=" 100%; height:60px;" scrollamount="10" scrolldelay="0" direction="left" behaviour="Scroll" >
              <table class="marquee-info" > 
                <tr>
                  <td  class="marquee-item" v-for="(item,index) in info_List"  :key="item.index" @click='showDetail(index)'>
                    {{ item.title }} 
                  </td> 
                </tr>
              </table> 
            </marquee>
    // 这是elementUI的走马灯效果
           <!-- <el-carousel arrow="never" type="string" interval="5000">
              <el-carousel-item  v-for="(item,index) in info_List"  :key="item.index" >
                <h3 @click='showDetail(index)' >{{ item.title }}</h3>
              </el-carousel-item>
          </el-carousel>  -->
     </div> 
      </div> 
    </template>
    <script>
    import axios from 'axios'
    export default {
      name: 'v-marquee-info',
      data() {
        return {
          info_List: []
        }
      },
      mounted(){
        axios.get('url/sdrs/web/goTZGG.action?type=1')
        .then((result) => { 
          let rs = result.data;
          let _this = this;
          if(rs.code == 1){
            let rs_list = rs.data.listNotice;
            for(let i = 0; i < rs_list.length; i++){
              _this.info_List.push(rs_list[i]);
            }
          }
        }).catch((err) => {
        });
      },
      methods:{
        showDetail: function(index){
          this.$store.state.i = index;
          for(var i = 0;i<this.info_List.length;i++){
            this.$store.state.detail = this.info_List[index].content;
            this.$store.state.title = this.info_List[index].title;
            this.$router.push({name: 'notiDetail'});
          }
        }
      },
    }
    </script>
    <style scoped lang="scss">
    .marquee-info-content {
      80%;
      margin: 240px auto auto auto;
      background:rgba(83,209,224,.5);
      position:relative;
      overflow:hidden;
      .marquee-info {
        height:60px;
        line-height:60px;
        font-family: 'Microsoft YaHei';
        .marquee-item {
          30px;
          color:#FAFFF8;
          font-size: 24px;
          padding:0 150px;
        }
      }
    }
    </style>
    <style lang="scss">
    //走马灯样式
    .el-carousel__container{
      text-align: center;
      line-height: 60px;
      font-size:26px;
      color:#fff;
      height:60px !important;
    }
    .el-carousel__indicator--horizontal{
      display: none !important;
    }
    </style>
  • 相关阅读:
    测试服务器centos7安装php7.2+composer
    开发工作流程
    CKEditor4多个span标签不合并的问题
    编程面试题
    vagrant常用命令
    设置apache服务器的访问证书,支持https访问,windows
    PHP5实现foreach语言结构遍历一个类的实例
    virtualbox虚拟机ubuntu操作系统,设置网络互通、访问,能访问虚拟机swoole的http服务
    二进制位运算
    dedecms学习笔记(1)--ShowMsg()
  • 原文地址:https://www.cnblogs.com/rxfn/p/10874038.html
Copyright © 2020-2023  润新知