当前位置: 移动技术网 > IT编程>开发语言>JavaScript > 使用jQuery UI的tooltip函数修饰title属性的气泡悬浮框

使用jQuery UI的tooltip函数修饰title属性的气泡悬浮框

2018年09月16日  | 移动技术网IT编程  | 我要评论

使用jquery ui的tooltip()函数,可以使悬浮提示框不再那么千篇一律。保存到html文件打开也可以看效果。

. 代码如下:


<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>使用jquery ui修饰title属性的气泡悬浮框(tooltip) - 柯乐义</title>
<script type="text/javascript" src="https://www.keleyi.com/keleyi/pmedia/jquery-1.9.1.min.js"></script>
<link rel="stylesheet" href="https://www.keleyi.com/keleyi/pmedia/jquery/ui/1.10.2/themes/sunny/jquery-ui.min.css" />
<script type="text/javascript" src="https://www.keleyi.com/keleyi/pmedia/jquery/ui/jquery-ui-1.10.2.custom.min.js"></script>
<script type="text/javascript">
$(function () {
$(document).tooltip();
});
</script>
<style type="text/css">
label {
display: inline-block;
}
</style>
</head>
<body>
<h2>不一样的悬浮提示框</h2>
<p>如果为一个元素添加了title属性,那么当光标移到该元素上时,会在元素旁显示出一个悬浮提示框。</p>
<p>一般悬浮提示框是无法使用样式修饰的,但如果使用<a href="https://www.keleyi.com/menu/jquery/" title="jquery特效、资料等学习内容。" target="_blank">jquery</a> ui,则可以显示不同效果了,方法很加单:$(document).tooltip(); </p><p>把光标移到输入框(或超链接)上看看悬浮提示框的效果吧。</p>
<p><label for="age">email:</label><input id="age" title="可作为取回密码的手段,建议填写。" /></p>
<p><a href="https://www.keleyi.com" target="_blank" title="柯乐义首页">柯乐义</a> 现在是样式一 <a href="https://www.keleyi.com/keleyi/phtml/tooltip/tooltip2.htm" title="样式二:redmond">样式二</a> <a href="https://www.keleyi.com/a/bjac/a6d651710217f7a0.htm" target="_blank" title="查看原文">原文</a></p>
</body>
</html>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网