Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zui
提交
5f75d5f0
Z
zui
项目概览
易企天创
/
zui
10 个月 前同步成功
通知
6
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
37
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
37
Issue
37
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5f75d5f0
编写于
3月 15, 2017
作者:
C
Catouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* change popover and tooltip document.
上级
b9b21cab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
145 addition
and
10 deletion
+145
-10
docs/index.json
docs/index.json
+7
-1
docs/part/javascript-popover.md
docs/part/javascript-popover.md
+48
-4
docs/part/javascript-tooltip.md
docs/part/javascript-tooltip.md
+90
-5
未找到文件。
docs/index.json
浏览文件 @
5f75d5f0
...
...
@@ -976,7 +976,9 @@
"topics"
:
[{
"name"
:
"示例"
},
{
"name"
:
"不同方向的提示"
"name"
:
"弹出方向"
},
{
"name"
:
"外观"
},
{
"name"
:
"选项"
},
{
...
...
@@ -995,6 +997,10 @@
"name"
:
"静态类型"
},
{
"name"
:
"动态演示"
},
{
"name"
:
"弹出方向"
},
{
"name"
:
"外观"
},
{
"name"
:
"用法"
}],
...
...
docs/part/javascript-popover.md
浏览文件 @
5f75d5f0
...
...
@@ -128,10 +128,13 @@ filter: tanchumianban tcmb
```
```
javascript
// 你需要手动进行初始化
$
(
'
[data-toggle="popover"]
'
).
popover
();
```
### 在不同方向弹出
## 弹出方向
使用
`placement`
选项来指定相对于元素显示的位置。
<div
class=
"example text-center"
>
<button
type=
"button"
class=
"btn"
data-toggle=
"popover"
data-placement=
"left"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
>
从左侧弹出
</button>
...
...
@@ -156,8 +159,49 @@ $('[data-toggle="popover"]').popover();
<button
type=
"button"
class=
"btn"
data-toggle=
"popover"
data-placement=
"right"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
>
从右侧弹出
</button>
```
```
javascript
$
(
'
[data-toggle="popover"]
'
).
popover
();
```
js
// 或者在初始化时指定弹出方向
$
(
'
[data-toggle="popover"]
'
).
popover
({
placement
:
'
bottom
'
});
```
## 外观
使用
`tipClass`
指定外观类名来更改颜色主题。
<div
class=
"example text-center"
>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"popover"
data-tip-class=
"popover-primary"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"left"
>
.popover-primary
</button>
<button
type=
"button"
class=
"btn btn-success"
data-toggle=
"popover"
data-tip-class=
"popover-success"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"top"
>
.popover-success
</button>
<button
type=
"button"
class=
"btn btn-info"
data-toggle=
"popover"
data-tip-class=
"popover-info"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"bottom"
>
.popover-info
</button>
<button
type=
"button"
class=
"btn btn-warning"
data-toggle=
"popover"
data-tip-class=
"popover-warning"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"top"
>
.popover-warning
</button>
<button
type=
"button"
class=
"btn btn-danger"
data-toggle=
"popover"
data-tip-class=
"popover-danger"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"right"
>
.popover-danger
</button>
</div>
```
html
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"popover"
data-tip-class=
"popover-primary"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"left"
>
.popover-primary
</button>
```
```
html
<button
type=
"button"
class=
"btn btn-success"
data-toggle=
"popover"
data-tip-class=
"popover-success"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"top"
>
.popover-success
</button>
```
```
html
<button
type=
"button"
class=
"btn btn-info"
data-toggle=
"popover"
data-tip-class=
"popover-info"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"bottom"
>
.popover-info
</button>
```
```
html
<button
type=
"button"
class=
"btn btn-warning"
data-toggle=
"popover"
data-tip-class=
"popover-warning"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"top"
>
.popover-warning
</button>
```
```
html
<button
type=
"button"
class=
"btn btn-danger"
data-toggle=
"popover"
data-tip-class=
"popover-danger"
data-content=
"千山鸟飞绝,万径人踪灭。"
title=
"江雪"
data-placement=
"right"
>
.popover-danger
</button>
```
```
js
// 或者在初始化时指定外观选项
$
(
'
[data-toggle="popover"]
'
).
popover
({
tipClass
:
'
danger
'
});
```
## 用法
...
...
@@ -255,7 +299,7 @@ $('[data-toggle="popover"]').popover();
<td>
`tipId`
</td>
<td>
字符串
</td>
<td>
`''`
</td>
<td>
为动态生成的
`.popover`
元素设置
`[id]`
属性。
</td>
<td>
为动态生成的
`.popover`
元素设置
ID
属性。
</td>
</tr>
</tbody>
</table>
...
...
docs/part/javascript-tooltip.md
浏览文件 @
5f75d5f0
...
...
@@ -21,7 +21,7 @@ filter: tishixiaoxi tsxx
<a
href=
"#"
data-toggle=
"tooltip"
title=
"英语:Cascading Style Sheets,简写CSS"
>
层叠样式表
</a>
```
```
j
avascript
```
j
s
// 你需要手动初始化工具提示
$
(
'
[data-toggle="tooltip"]
'
).
tooltip
();
```
...
...
@@ -34,13 +34,78 @@ $('[data-toggle="tooltip"]').tooltip();
</div>
## 不同方向的提示
## 弹出方向
使用
`placement`
选项来指定工具提示相对于元素显示的位置。
<div
class=
"example tooltip-demo"
>
<button
type=
"button"
class=
"btn btn-default"
data-toggle=
"tooltip"
data-placement=
"left"
title=
""
data-original-title=
"左侧提示内容"
>
左侧提示
</button>
<button
type=
"button"
class=
"btn btn-default"
data-toggle=
"tooltip"
data-placement=
"top"
title=
""
data-original-title=
"上方提示内容"
>
上方提示
</button>
<button
type=
"button"
class=
"btn btn-default"
data-toggle=
"tooltip"
data-placement=
"bottom"
title=
""
data-original-title=
"下方提示内容"
>
下方提示
</button>
<button
type=
"button"
class=
"btn btn-default"
data-toggle=
"tooltip"
data-placement=
"right"
title=
""
data-original-title=
"右侧提示内容"
>
右侧提示
</button>
<button
type=
"button"
class=
"btn"
data-toggle=
"tooltip"
data-placement=
"left"
title=
"左侧提示内容"
>
左侧提示
</button>
<button
type=
"button"
class=
"btn"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"上方提示内容"
>
上方提示
</button>
<button
type=
"button"
class=
"btn"
data-toggle=
"tooltip"
data-placement=
"bottom"
title=
"下方提示内容"
>
下方提示
</button>
<button
type=
"button"
class=
"btn"
data-toggle=
"tooltip"
data-placement=
"right"
title=
"右侧提示内容"
>
右侧提示
</button>
</div>
使用
`placement`
选项来指定工具提示相对于元素显示的位置。
```
html
<button
type=
"button"
class=
"btn"
data-toggle=
"tooltip"
data-placement=
"left"
title=
"左侧提示内容"
>
左侧提示
</button>
```
```
html
<button
type=
"button"
class=
"btn"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"上方提示内容"
>
上方提示
</button>
```
```
html
<button
type=
"button"
class=
"btn"
data-toggle=
"tooltip"
data-placement=
"bottom"
title=
"下方提示内容"
>
下方提示
</button>
```
```
html
<button
type=
"button"
class=
"btn"
data-toggle=
"tooltip"
data-placement=
"right"
title=
"右侧提示内容"
>
右侧提示
</button>
```
```
js
// 或者在初始化时指定
$
(
'
[data-toggle="tooltip"]
'
).
tooltip
({
placement
:
'
bottom
'
});
```
## 外观
使用
`tipClass`
指定外观类名来更改颜色主题。
<div
class=
"example tooltip-demo"
>
<a
class=
"text-primary"
data-toggle=
"tooltip"
data-tip-class=
"tooltip-primary"
title=
"tooltip-primary"
>
.tooltip-primary
</a>
<a
class=
"text-success"
data-toggle=
"tooltip"
data-tip-class=
"tooltip-success"
title=
"tooltip-success"
>
.tooltip-success
</a>
<a
class=
"text-info"
data-toggle=
"tooltip"
data-tip-class=
"tooltip-info"
title=
"tooltip-info"
>
.tooltip-info
</a>
<a
class=
"text-warning"
data-toggle=
"tooltip"
data-tip-class=
"tooltip-warning"
title=
"tooltip-warning"
>
.tooltip-warning
</a>
<a
class=
"text-danger"
data-toggle=
"tooltip"
data-tip-class=
"tooltip-danger"
title=
"tooltip-danger"
>
.tooltip-danger
</a>
</div>
```
html
<a
data-toggle=
"tooltip"
data-tip-class=
"tooltip-primary"
title=
"tooltip-primary"
>
.tooltip-primary
</a>
```
```
html
<a
data-toggle=
"tooltip"
data-tip-class=
"tooltip-success"
title=
"tooltip-success"
>
.tooltip-success
</a>
```
```
html
<a
data-toggle=
"tooltip"
data-tip-class=
"tooltip-info"
title=
"tooltip-info"
>
.tooltip-info
</a>
```
```
html
<a
data-toggle=
"tooltip"
data-tip-class=
"tooltip-warning"
title=
"tooltip-warning"
>
.tooltip-warning
</a>
```
```
html
<a
data-toggle=
"tooltip"
data-tip-class=
"tooltip-danger"
title=
""
data-original-title=
"tooltip-danger"
>
.tooltip-danger
</a>
```
```
js
// 或者在初始化时指定
$
(
'
[data-toggle="tooltip"]
'
).
tooltip
({
tipClass
:
'
tooltip-success
'
});
```
## 选项
...
...
@@ -115,6 +180,18 @@ $('[data-toggle="tooltip"]').tooltip();
<td>
`'hover focus'`
</td>
<td>
指定哪些事件会触发显示提示消息,多个事件用空格隔开,可选值包括:
`'click'`
、
`'hover'`
、
`'focus'`
、
`'manual'`
。
</td>
</tr>
<tr>
<td>
`tipId`
</td>
<td>
字符串
</td>
<td>
`''`
</td>
<td>
当工具提示显示时为动态创建的
`.tooltip`
元素指定一个 ID 属性。
</td>
</tr>
<tr>
<td>
`tipClass`
</td>
<td>
字符串
</td>
<td>
`''`
</td>
<td>
当工具提示显示时为动态创建的
`.tooltip`
元素指定一个 CLASS 属性,多个 CLASS 使用空格分隔。
</td>
</tr>
</tbody>
</table>
...
...
@@ -132,6 +209,14 @@ $('[data-toggle="tooltip"]').tooltip();
$
(
'
#element
'
).
tooltip
(
'
show
'
);
```
### <span class="code">.tooltip('show', content)</span>
展示工具提示并指定要显示的文本内容。
```
javascript
$
(
'
#element
'
).
tooltip
(
'
show
'
,
'
这是新的工具提示内容
'
);
```
### <span class="code">.tooltip('hide')</span>
隐藏工具提示。
...
...
@@ -195,6 +280,6 @@ $('[data-toggle="tooltip"]').on('show.zui.tooltip', function() {
<script>
function afterPageLoad() {
$('#pageContent [data-toggle="tooltip"]').tooltip();
$('#pageContent [data-toggle="tooltip"]').tooltip()
.tooltip('show')
;
}
</script>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录