CSS:

/* Make it a marquee */
.marquee {  width: 450px;margin: 0 auto;overflow: hidden;white-space: nowrap;box-sizing: border-box;animation: marquee 50s linear infinite;}
.marquee:hover {animation-play-state: paused}
/* Make it move */
@keyframes marquee { 0%   { text-indent: 27.5em }100% { text-indent: -105em }}
/* Style the links */
.marqueeWord a { color: #1570A6;transition: color .5s;text-decoration: none;}
.marqueeWord a:hover {color: #F65314;}

HTML:

 <p class="marquee marqueeWord">
        <a ng-repeat="new in news" ng-href="new.url">{{new.title}} &nbsp; &nbsp; &nbsp;</a>
</p>

其中HTML部分的数组是用AngularJS循环出来的。

其中 .matquee样式类中的animation中的50S,是用来调整轮播速度,值越小越快。infinite代表无限循环(循环次数)。

 

相关文章:

  • 2021-11-26
  • 2021-08-12
  • 2021-12-02
  • 2021-11-28
  • 2021-08-19
  • 2022-01-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
  • 2022-12-23
  • 2021-11-28
  • 2021-03-30
  • 2022-12-23
相关资源
相似解决方案