<!-- <HEADER> // IGNORE IT -->
<p align="center">
<img src="https://rawcdn.githack.com/popperjs/popper-core/8805a5d7599e14619c9e7ac19a3713285d8e5d7f/docs/src/images/popper-logo-outlined.svg" alt="Popper" height="300px"/>
</p>
<div align="center">
<h1>Tooltip & Popover Positioning Engine</h1>
</div>
<p align="center">
<a href="https://www.npmjs.com/package/@popperjs/core">
<img src="https://img.shields.io/npm/v/@popperjs/core?style=for-the-badge" alt="npm version" />
</a>
<a href="https://www.npmjs.com/package/@popperjs/core">
<img src="https://img.shields.io/endpoint?style=for-the-badge&url=https://runkit.io/fezvrasta/combined-npm-downloads/1.0.0?packages=popper.js,@popperjs/core" alt="npm downloads per month (popper.js + @popperjs/core)" />
</a>
<a href="https://rollingversions.com/popperjs/popper-core">
<img src="https://img.shields.io/badge/Rolling%20Versions-Enabled-brightgreen?style=for-the-badge" alt="Rolling Versions" />
</a>
</p>
<br />
<!-- </HEADER> // NOW BEGINS THE README -->
**Positioning tooltips and popovers is difficult. Popper is here to help!**
Given an element, such as a button, and a tooltip element describing it, Popper
will automatically put the tooltip in the right place near the button.
It will position _any_ UI element that "pops out" from the flow of your document
and floats near a target element. The most common example is a tooltip, but it
also includes popovers, drop-downs, and more. All of these can be generically
described as a "popper" element.
## Demo
[![Popper visualized](https://i.imgur.com/F7qWsmV.jpg)](https://popper.js.org)
## Docs
- [v2.x (latest)](https://popper.js.org/docs/v2/)
- [v1.x](https://popper.js.org/docs/v1/)
We've created a
[Migration Guide](https://popper.js.org/docs/v2/migration-guide/) to help you
migrate from Popper 1 to Popper 2.
To contribute to the Popper website and documentation, please visit the [dedicated repository](https://github.com/popperjs/website).
## Why not use pure CSS?
CSS tooltips have accessibility and usability problems:
- **Clipping and overflow issues**: CSS tooltips will not be prevented from
overflowing clipping boundaries, such as the viewport. The tooltip gets
partially cut off or overflows if it's near the edge since there is no dynamic
positioning logic. When using Popper, your tooltip will always be positioned
in the right place.
- **No flipping**: CSS tooltips will not flip to a different placement to fit
better in view if necessary. Popper automatically flips the tooltip to make it
fit in view as best as possible for the user.
- **Using HTML**: Popovers containing interactive HTML are difficult or not
possible to create without UX issues using pure CSS. Popper positions any HTML
element – no pseudo-elements are used.
- **No virtual positioning**: CSS tooltips cannot follow the mouse cursor or be
used as a context menu. Popper allows you to position your tooltip relative to
any coordinates you desire.
- **Lack of extensibility**: CSS tooltips cannot be easily extended to fit any
arbitrary use case you may need to adjust for. Popper is built with
extensibility in mind.
## Why Popper?
With the CSS drawbacks out of the way, we now move on to Popper in the
JavaScript space itself.
Naive JavaScript tooltip implementations usually have the following problems:
- **Scrolling containers**: They don't ensure the tooltip stays with the
reference element while scrolling when inside any number of scrolling
containers.
- **DOM context**: They often require the tooltip move outside of its original
DOM context because they don't handle `offsetParent` contexts.
- **Configurability**: They often lack advanced configurability to suit any
possible use case.
- **Size**: They are usually relatively large in size, or require an ancient
jQuery dependency.
- **Performance**: They often have runtime performance issues and update the
tooltip position too slowly.
**Popper solves all of these key problems in an elegant, performant manner.** It
is a lightweight ~3 kB library that aims to provide a reliable and extensible
positioning engine you can use to ensure all your popper elements are positioned
in the right place.
When you start writing your own popper implementation, you'll quickly run into
all of the problems mentioned above. These widgets are incredibly common in our
UIs; we've done the hard work figuring this out so you don't need to spend hours
fixing and handling numerous edge cases that we already ran into while building
the library!
Popper is used in popular libraries like Bootstrap, Foundation, Material UI, and
more. It's likely you've already used popper elements on the web positioned by
Popper at some point in the past few years.
Since we write UIs using powerful abstraction libraries such as React or Angular
nowadays, you'll also be glad to know Popper can fully integrate with them and
be a good citizen together with your other components. Check out `react-popper`
for the official Popper wrapper for React.
## Installation
### 1. Package Manager
```bash
# With npm
npm i @popperjs/core
# With Yarn
yarn add @popperjs/core
```
### 2. CDN
```html
<!-- Development version -->
<script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.js"></script>
<!-- Production version -->
<script src="https://unpkg.com/@popperjs/core@2"></script>
```
### 3. Direct Download?
Managing dependencies by "directly downloading" them and placing them into your
source code is not recommended for a variety of reasons, including missing out
on feat/fix updates easily. Please use a versioning management system like a CDN
or npm/Yarn.
## Usage
The most straightforward way to get started is to import Popper from the `unpkg`
CDN, which includes all of its features. You can call the `Popper.createPopper`
constructor to create new popper instances.
Here is a complete example:
```html
<!DOCTYPE html>
<title>Popper example</title>
<style>
#tooltip {
background-color: #333;
color: white;
padding: 5px 10px;
border-radius: 4px;
font-size: 13px;
}
</style>
<button id="button" aria-describedby="tooltip">I'm a button</button>
<div id="tooltip" role="tooltip">I'm a tooltip</div>
<script src="https://unpkg.com/@popperjs/core@^2.0.0"></script>
<script>
const button = document.querySelector('#button');
const tooltip = document.querySelector('#tooltip');
// Pass the button, the tooltip, and some options, and Popper will do the
// magic positioning for you:
Popper.createPopper(button, tooltip, {
placement: 'right',
});
</script>
```
Visit the [tutorial](https://popper.js.org/docs/v2/tutorial/) for an example of
how to build your own tooltip from scratch using Popper.
### Module bundlers
You can import the `createPopper` constructor from the fully-featured file:
```js
import { createPopper } from '@popperjs/core';
const button = document.querySelector('#button');
const tooltip = document.querySelector('#tooltip');
// Pass the button, the tooltip, and some options, and Popper will do the
// magic positioning for you:
createPopper(button, tooltip, {
placement: 'right',
});
```
All the modifiers listed in the docs menu will be enabled and "just work", so
you don't need to think about setting Popper up. The size of Popper including
all of its features is about 5 kB minzipped, but it may grow a bit in the
future.
#### Popper Lite (tree-shaking)
If bundle size is important, you'll want to take advantage of tree-shaking. The
library is built in a modular way to allow to import only the parts you really
need.
```js
import { createPopperLite as createPopper } from "@popperjs/core";
```
The Lite version includes the most necessary modifiers that will compute the
offsets of the popper, compute and add the positioning styles, and add event
listeners. This is close in bundle size to pure CSS tooltip libraries, and
behaves somewhat similarly.
However, this does not include the fea
没有合适的资源?快使用搜索试试~ 我知道了~
Vant@2.11.2版本下载
共1614个文件
js:1030个
less:192个
css:190个
需积分: 47 31 下载量 15 浏览量
2020-12-11
11:09:45
上传
评论 1
收藏 1.7MB RAR 举报
温馨提示
Vant@2.11.2版本下载 Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源,已持续维护 4 年时间。Vant 对内承载了有赞所有核心业务,对外服务十多万开发者,是业界主流的移动端组件库之一
资源详情
资源评论
资源推荐
收起资源包目录
Vant@2.11.2版本下载 (1614个子文件)
.babelrc 131B
vant.css 139KB
index.css 139KB
local.css 74KB
local.css 74KB
index.css 41KB
index.css 41KB
index.css 6KB
index.css 6KB
index.css 5KB
index.css 5KB
base.css 5KB
base.css 5KB
animation.css 4KB
animation.css 4KB
index.css 3KB
index.css 3KB
index.css 3KB
index.css 3KB
index.css 3KB
index.css 3KB
index.css 3KB
index.css 3KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 2KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
reset.css 1KB
reset.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 1KB
index.css 986B
index.css 986B
index.css 920B
index.css 920B
index.css 879B
index.css 879B
index.css 842B
index.css 842B
index.css 809B
共 1614 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
Smile丿斌
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【新增】-033 -服装公司薪酬制度.doc
- 【新增】-036 -工程公司薪酬方案.doc
- 永磁同步电机(pmsm)矢量控制控制(FOC)matlab simulink仿真模型
- 【新增】-039 -工程公司薪酬体系设计方案.doc
- 【新增】-044 -广告公司薪酬方案.doc
- 【新增】-048 -互联网公司薪酬体系设计方案及标准.doc
- 【新增】-046 -国际(香港)有限公司薪酬体系设计方案.doc
- 【新增】-049 -花卉超市薪酬管理制度.doc
- 【新增】-054 -化妆品公司薪酬体系.doc
- 【新增】-056 -化妆品销售部薪酬与绩效考核方案 (1).doc
- 【新增】-061 -建材公司薪酬体系.doc
- 【新增】-064 -教育培训机构各岗位薪酬体系标准.doc
- 【新增】-070 -科技公司薪酬体系方案.doc
- 【新增】-055 -化妆品公司薪资管理与绩效考核制度.doc
- 【新增】-068 -科技公司薪酬体系.doc
- 【新增】-075 -连锁门店及总部薪酬体系.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0