灵活和可定制 jQuery新闻提示插件 轻松提示

  • 源码大小:25.45KB
  • 所需积分:1积分
  • 源码编号:19JP-3738
  • 浏览次数:306次
  • 最后更新:2023年07月17日
  • 所属栏目:动画
我要下载
加入收藏
本站默认解压密码:19jp.com 或 19jp_com

简介

Easy Ticker是一个jQuery插件,可帮助您在网页上创建一个高度可定制、跨浏览器、SEO友好、灵活且无限的新闻Ticker。

特征:

  • 重量轻(缩小约3kb),易于使用
  • 允许向下或向上滚动新闻滚动条中的项目。
  • 加载页面时自动滚动,鼠标悬停时停止。
  • 允许开箱即用地控制行为。
  • 可自定义缓和和动画选项。

相关插件:

  • jQuery插件用于动画垂直Ticker-图腾
  • BBC新闻类网站Ticker插件与jQuery-新闻Ticker
  • 高度可定制的jQuery文本滚动插件-Web Ticker
  • 使用jQuery的汤博乐新闻提示小工具
  • jQuery垂直滚动Web Ticker插件-vticker
  • 类似新闻Ticker的内容滚动插件用于jQuery-轻松Ticker
  • 轻松jQuery滚动新闻提示插件-liScroll

基本用法:

1.在文档中包含最新的jQuery库和jQuery.easy-ticker.js。

<script src="/path/to/cdn/jquery.min.js"></script> 
<script src="/path/to/dist/jquery.easy-ticker.min.js"></script> 

2.包含用于缓解功能的jQuery缓解插件。(可选)

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js"></script>

3.为你的新闻行情创建html。

<div class="demo">
  <ul>
    <li>
       <img src="https://www.jqueryscript.net/small/images/jQuery-Plugin-To-Expand-Collapse-Input-Field-Expandable-Input.jpg" alt="Expandable Input" />
       <a href="https://www.jqueryscript.net/form/jQuery-Plugin-To-Expand-Collapse-Input-Field-Expandable-Input.html">Expandable Input</a>
       <p>Expandable Input is a minimal jQuery plugin to smoothly expand the width of a input filed when focused/clicked and collapse it when lose focus.</p>
    </li>
    <li class="odd">
       <img src="https://www.jqueryscript.net/small/images/Creating-A-Full-Page-Photo-Gallery-with-jQuery-Photor-Plugin.jpg" alt="jQuery Photor Plugin" />
       <a href="https://www.jqueryscript.net/gallery/Creating-A-Full-Page-Photo-Gallery-with-jQuery-Photor-Plugin.html">jQuery Photor Plugin</a>
       <p>Photor is a fast and easy jQuery plugin to create a responsive & touch-friendly full page image gallery with CSS3 transitions and transforms.</p>
    </li>
    <li>
       <img src="https://www.jqueryscript.net/small/images/Windows-8-Style-jQuery-Data-Table-Decorator-Metreaux-Tables.jpg" alt="Metreaux Tables" />
       <a href="https://www.jqueryscript.net/table/Windows-8-Style-jQuery-Data-Table-Decorator-Metreaux-Tables.html">Metreaux Tables</a>
       <p>Metreaux Tables is a jQuery plugin to create nice, clean, themeable, andmodern Windows 8 UI Style data tables with the power of DataTables jQuery javascript library.</p>
    </li>
    ...
  </ul>
</div>

4.使用默认设置调用插件。就是这样。

$(function(){
  $('.demo').easyTicker();
});

5.所有可能的选项来配置新闻行情。

$('.demo').easyTicker({

  // or 'down'
  direction: 'up',

  // easing function
  easing: 'swing',

  // animation speed
  speed: 'slow',

  // animation delay
  interval: 2000,

  // height
  height: 'auto',

  // the number of visible elements of the list
  visible: 0,

  // enables pause on hover
  mousePause: true,

  // enables autoplay
  autoplay: true,

  // custom controls
  controls: {
    up: '',
    down: '',
    toggle: '',
    playText: 'Play',
    stopText: 'Stop'
  },

  // callbacks
  callbacks: {
    before: function(ul, li){
      // do something
    },
    after: function(ul, li){
      // do something
    },
    finish: function(ul, li){
      // do something
    }
  }
  
});

更新日志:

版本3.4.0(2022-01-23)

  • 新的自动播放选项

版本3.4.0(2022-01-21)

  • 高度调整完成后要调用的新回调
  • 删除了初始化时延迟的高度调整

版本3.3.0(2022-01-03)

  • 使用按钮快速移动股票行情时处理问题

第3.2.1版(2020-04-13)

  • 使用visibilityChange API进行窗口焦点检测
  • 处理多次启动尝试

2020-04-13

  • v3.1.0:修复高CPU消耗错误

预览截图