zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    Xilinx之软件平台 ISE与Vivado前世今生
    博客开园
    第一天:开始你的Jobeet项目
    MySQL之alter语句用法总结
    SELECT INTO 和 INSERT INTO SELECT 两种表复制语句
    MySQL中distinct和group by性能比较[转]
    GROUP BY,WHERE,HAVING之间的区别和用法
    split(),preg_split()与explode()函数分析与介
    解析posix与perl标准的正则表达式区别
    sql关键字的解释执行顺序
  • 原文地址:https://www.cnblogs.com/rxfn/p/10874038.html
Copyright © 2011-2022 走看看