jquery实现标签提示
来源:互联网 发布:淘宝开店考试答案 编辑:程序博客网 时间:2024/06/05 20:00
先看下效果图:
贴下代码:
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="../scripts/jquery-1.3.1.js" type="text/javascript"></script> <title>提示</title></head><style type="text/css">.tishi{ border:1px dotted #ffffff; width: 150px; height: 25px; font-size: 12px; background-color: #e06e0c; line-height:25px; color: #fffefe; font-weight: bolder; text-align:center; position:absolute; display:none;}</style><body align="center" style="padding-top:200px;"> <a href="" title="这是第一个标签">这是第一个标签</a><p> <a href="" title="这是第二个标签">这是第二个标签</a><p> <a href="" title="这是第三个标签">这是第三个标签</a><p> <a href="" title="这是第四个标签">这是第四个标签</a><p></body></html><script type="text/javascript"> $(document).ready(function(){ //鼠标移进事件 $("a").mouseover(function(e){ //添加提示款 $("body").append("<div class='tishi'>"+this.title+"</div>"); //设置提示框坐标 $('.tishi').css({ //第一种方式:鼠标第一次进入位置坐标弹出提示框 "top": e.pageY + "px", "left": e.pageX + "px" /*第二种方式:在要提示的标签右下角弹出提示框 "top": $(this).offset().top+$(this).height() + "px", "left": $(this).offset().left+$(this).width() + "px"*/ }).show(200); //鼠标移出事件 }).mouseout(function(){ //移除提示框 $(".tishi").remove(); }); });</script>
代码很简单。就不解释了。
阅读全文
0 0
- jquery实现标签提示
- jquery 文本框提示标签
- jQuery实现点击文本框弹出热门标签的提示示例
- JQuery实现自动提示
- jquery实现loading...提示
- JQUERY实现搜索提示
- jquery实现冒泡提示
- jquery实现自动提示
- JQuery--实现标签页
- <datalist>标签实现提示功能
- jQuery 实现提示信息或登录提示
- jquery实现简单文字提示
- jquery实现用户等待提示
- jquery实现用户名密码提示
- jquery实现多标签折页
- jQuery 实现Tab标签切换
- jquery实现标签切换效果
- jquery实现标签属性控制
- hdu2586 倍增lca模板
- 【Scikit-Learn 中文文档】半监督学习
- ZOJ Problem Set
- eclipse配置黑色主题以及更多其他主题
- HDU 2669 Romantic 【exgcd】
- jquery实现标签提示
- 【Scikit-Learn 中文文档】概率校准
- 唯快不破:TCP/IP详解--网络层 && IP首部格式
- Java实现归并排序
- width与高之间自动适应
- Fresco请求图片
- 2017.11.25【NOIP提高组】模拟赛B组总结
- 【Scikit-Learn 中文文档】神经网络模块(监督的)- 监督学习
- U盘变成文件夹