插件 jQuery.miniTip 中文API文档

🌙
手机阅读
本文目录结构

插件 jQuery.miniTip 中文API文档 https://github.com/goldfire/miniTip jQuery miniTip Plugin (v1.5.3)

License

Dual licensed under the MIT and GPL licenses:

Copyright 2011, James Simpson http://goldfirestudios.com

Description

miniTip is an ultra lightweight jQuery plugin that creates highly customizable tooltips without all of the fluff.

Features

  • JS + CSS is just 4.5kb minified (1.7kb gzipped)!
  • No images
  • Automatically stays within viewport
  • Automatic support for image maps
  • Extremely easy to style
  • Use text or HTML from title tag, hidden element, or JS declaration
  • Fade in and out
  • Set custom delay for show/hide
  • Specify default anchor position
  • Persistent tooltip that only closes when mouse moves off of tooltip and anchor element
  • Support for hover and click events
  • Optional title bar
  • Tested in: IE7+, Firefox 3.5+, Safari 3+, Chrome, Opera 10+
  • More features can be found at the miniTip home page

Documentation

Please go to the miniTip home page to view the full documentation (it is really straightforward, I promise!).

Examples

This is the most basic usage. It displays a miniTip on mouseover of the element with ID “tip” and content of the title tag (maximum width of 250px). Mouseout of the “tip” hides the miniTip.

$('#tip').miniTip();

This is a more advanced example utilizing all available options (as of v1.0). The element with ID of “tip” will be activated by click instead of mouseover. It will have a title bar with text “Title Bar” and content defined in the JS call. It will wait .5s before showing and hiding the tooltip, and the fade animation will be .5s both ways. The default anchor position is east (the right side of the anchor element). Auto-hide is set to false, so the tooltip will only hide once your mouse is off of the tooltip and the anchor element. The max width is set to 50px and the offset is 15px, so the tooltip’s stem will be 15px from the edge of the anchor element. Finally, an event will fire when the tooltip is shown (alerting “Hello,”), and another will be fired when it is hidden (alerting “World!”).

$('#tip').miniTip({
  title: 'Title Bar',
  content: 'This is a test miniTip!',
  delay: 500,
  anchor: 'e',
  event: 'click',
  fadeIn: 500,
  fadeOut: 500,
  aHide: false,
  maxW: '50px',
  offset: 15,
  stemOff: 0,
  show: function(){ alert('Hello,'); },
  hide: funciton(){ alert('World!'); }
});

More examples and live demos can be found at http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin

Requirements

  • jQuery v1.3+

AXIHE / 精选资源

浏览全部教程

面试题

学习网站

前端培训
自己甄别

前端书籍

关于朱安邦

我叫 朱安邦,阿西河的站长,在杭州。

以前是一名平面设计师,后来开始接接触前端开发,主要研究前端技术中的JS方向。

业余时间我喜欢分享和交流自己的技术,欢迎大家关注我的 Bilibili

关注我: Github / 知乎

于2021年离开前端领域,目前重心放在研究区块链上面了

我叫朱安邦,阿西河的站长

目前在杭州从事区块链周边的开发工作,机械专业,以前从事平面设计工作。

2014年底脱产在老家自学6个月的前端技术,自学期间几乎从未出过家门,最终找到了满意的前端工作。更多>

于2021年离开前端领域,目前从事区块链方面工作了