AI智能
改变未来

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

使用jQuery UI的tooltip()函数,可以使悬浮提示框不再那么千篇一律。点击这里先看看效果吧:http://www.keleyi.com/keleyi/phtml/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=\"http://www.keleyi.com/keleyi/pmedia/jquery-1.9.1.min.js\"></script><link rel=\"stylesheet\" href=\"http://www.keleyi.com/keleyi/pmedia/jquery/ui/1.10.2/themes/sunny/jquery-ui.min.css\" /><script type=\"text/javascript\" src=\"http://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=\"http://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=\"http://www.keleyi.com\" target=\"_blank\" title=\"柯乐义首页\">柯乐义</a> 现在是样式一 <a href=\"http://www.keleyi.com/keleyi/phtml/tooltip/tooltip2.htm\" title=\"样式二:redmond\">样式二</a> <a href=\"http://www.keleyi.com/a/bjac/a6d651710217f7a0.htm\" target=\"_blank\" title=\"查看原文\">原文</a></p></body></html>

 

本文转载自柯乐义:http://www.keleyi.com/a/bjac/a6d651710217f7a0.htm

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » 使用jQuery UI修饰title属性的气泡悬浮框