jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery
本文实例讲述了jQuery实现鼠标跟随提示层效果代码。分享给大家供大家参考,具体如下:
运行效果截图如下:
Web网站有不少需要用到tip提示层的地方,结合jquery的jquery.cluetip.js ,可以实现本地字符或ajax异步调用显示提示层。如以上购评分明细提示。(优势:宽度需要调用页加载时定义,高度auto , 且三角指定图标能根据显示层的大小位置来调用它的位置,达到醒目直观的效果)
jquery.cluetip.css
/* global */ #cluetip-jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery img { border: 0; } #cluetip-title { overflow: hidden; } #cluetip-title #cluetip-jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery { float: right; position: relative; } #cluetip-waitimage { width: 43px; height: 11px; position: absolute; background-image: url(../img_new/cluetipwait.gif); } .cluetip-arrows { display: none; position: absolute; top: 0; left: -11px; height: 22px; width: 11px; background-repeat: no-repeat; background-position: 0 0; } #cluetip-extra { display: none; } /*************************************** =cluetipClass: 'default' -------------------------------------- */ .cluetip-default { background-color: #d9d9c2; } .cluetip-default #cluetip-outer { position: relative; margin: 0; background-color: #d9d9c2; } .cluetip-default h3#cluetip-title { margin: 0 0 5px; padding: 8px 10px 4px; font-size: 14px; font-weight: normal; background-color: #87876a; color: #fff; } .cluetip-default #cluetip-title a { color: #d9d9c2; font-size: 0.95em; } .cluetip-default #cluetip-inner { padding: 10px; } .cluetip-default div#cluetip-jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery { text-align: right; margin: 0 5px 5px; color: #900; } /* default arrows */ .clue-right-default .cluetip-arrows { background-image: url(../img_new/cluetipdarrowleft.gif); } .clue-left-default .cluetip-arrows { background-image: url(../img_new/cluetipdarrowright.gif); left: 100%; margin-right: -11px; } .clue-top-default .cluetip-arrows { background-image: url(../img_new/cluetipdarrowdown.gif); top: 100%; left: 50%; margin-left: -11px; height: 11px; width: 22px; } .clue-bottom-default .cluetip-arrows { background-image: url(../img_new/cluetipdarrowup.gif); top: -11px; left: 50%; margin-left: -11px; height: 11px; width: 22px; } /*************************************** =cluetipClass: 'jtip' -------------------------------------- */ .cluetip-jtip { background-color: transparent; display:none; } .cluetip-jtip #cluetip-outer { border: 1px solid #559EF8; position: relative; background-color: #fff; } .cluetip-jtip h3#cluetip-title { margin: 0 0 5px; padding: 2px 5px; font-size: 12px; font-weight: normal; background-color: #559EF8; color: #fff; } .cluetip-jtip #cluetip-inner { padding: 0 5px 5px; display: inline-block; } .cluetip-jtip div#cluetip-jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery { text-align: right; margin: 0 5px 5px; color: #900; display:none; } /* jtip arrows */ .clue-right-jtip .cluetip-arrows { background-image: url(../img_new/cluetiparrowleft.gif); } .clue-left-jtip .cluetip-arrows { background-image: url(../img_new/cluetiparrowright.gif); left: 100%; margin-right: -11px; } .clue-top-jtip .cluetip-arrows { background-image: url(../img_new/cluetiparrowdown.gif); top: 100%; left: 50%; margin-left: -11px; height: 11px; width: 22px; } .clue-bottom-jtip .cluetip-arrows { background-image: url(../img_new/cluetiparrowup.gif); top: -11px; left: 50%; margin-left: -11px; height: 11px; width: 22px; } /*************************************** =cluetipClass: 'rounded' -------------------------------------- */ .cluetip-rounded { background: transparent url(../img_new/cluetipbl.gif) no-repeat 0 100%; margin-top: 10px; margin-left: 12px; } .cluetip-rounded #cluetip-outer { background: transparent url(../img_new/cluetiptl.gif) no-repeat 0 0; margin-top: -12px; } .cluetip-rounded #cluetip-title { background-color: transparent; padding: 12px 12px 0; margin: 0 -12px 0 0; position: relative; } .cluetip-rounded #cluetip-extra { position: absolute; display: block; background: transparent url(../img_new/cluetiptr.gif) no-repeat 100% 0; top: 0; right: 0; width: 12px; height: 30px; margin: -12px -12px 0 0; } .cluetip-rounded #cluetip-inner { background: url(../img_new/cluetipbr.gif) no-repeat 100% 100%; padding: 5px 12px 12px; margin: -18px -12px 0 0; position: relative; } .cluetip-rounded div#cluetip-jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery { text-align: right; margin: 0 5px 5px; color: #009; background: transparent; } .cluetip-rounded div#cluetip-jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery a { color: #777; } /* rounded arrows */ .clue-right-rounded .cluetip-arrows { background-image: url(../img_new/cluetiprarrowleft.gif); } .clue-left-rounded .cluetip-arrows { background-image: url(../img_new/cluetiprarrowright.gif); left: 100%; margin-left: 12px; } .clue-top-rounded .cluetip-arrows { background-image: url(../img_new/cluetiprarrowdown.gif); top: 100%; left: 50%; margin-left: -11px; height: 11px; width: 22px; } .clue-bottom-rounded .cluetip-arrows { background-image: url(../img_new/cluetiprarrowup.gif); top: -23px; left: 50%; margin-left: -11px; height: 11px; width: 22px; } /* stupid IE6 HasLayout hack */ .cluetip-rounded #cluetip-title, .cluetip-rounded #cluetip-inner { zoom: 1; } .float-left { float: left; margin-right: .5em; display: inline; position: relative; } .float-right { float: right; margin-left: .5em; display: inline; position: relative; }
jquery-1.3.2.min.js -- 官方网可下载,这里不再表述。(必须)
jquerycluetipLoad.js --提示层的基本参数和属性的定义。
/* Jquery 鼠标跟随提示层。 * 创建人:fooo * 创建日期:09-09-23 * 修改人: * 修改日期: * 本地字符提示示例:<span title="标题|<%=Str()%>"><a href="#" >我们的</a></span> * Ajax异步调用文件且提示示例:<ol><li><a class="jt" href="#" title="评分项目明细" rel="HandlerAjax.ashx?Name=<%=Security.EncryptQueryString("我们的我我我人大")%>" >clueTip - Ajax异步提示1</a> </li></ol> * * 改变提示层宽度大小,只需在调用页加入: $.fn.cluetip.defaults.width = '100'; -根据大小调整。 */ // $.fn.cluetip.defaults.tracking = true; // $.fn.cluetip.defaults.width = 'auto'; $(document).ready(function() { //default theme $('a.title').cluetip({splitTitle: '|'}); $('a.basic').cluetip(); $('a.custom-width').cluetip({width: '200px', showTitle: false}); $('h4').cluetip({attribute: 'id', hoverClass: 'highlight'}); $('#sticky').cluetip({sticky: true, jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jqueryPosition: 'title', arrows: true }); $('#examples a:eq(5)').cluetip({ hoverClass: 'highlight', sticky: true, jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jqueryPosition: 'bottom', jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jqueryText: '<img src="/static/imghw/default1.png" data-src="../img_new/cluetipcross.png" class="lazy" alt="jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery" style="max-width:90%" style="max-width:90%" />', truncate: 60 }); $('a.load-local').cluetip({local:true, hideLocal: true, sticky: true, arrows: true, cursor: 'pointer'}); $('#clickme').cluetip({activation: 'click', sticky: true, width: 250}); $('ol:first a:last').cluetip({tracking: true}); //jTip theme $('a.jt:eq(0)').cluetip({ cluetipClass: 'jtip', arrows: true, dropShadow: false, sticky: true, mouseOutClose: true, jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jqueryPosition: 'title', jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jqueryText: '<img src="/static/imghw/default1.png" data-src="../img_new/cluetipcross.png" class="lazy" alt="jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)_jquery" />' }); $('a.jt:eq(1)').cluetip({cluetipClass: 'jtip', arrows: true, dropShadow: false, hoverIntent: false}); $('span[title]').css({borderBottom: '0px solid #900'}).cluetip({splitTitle: '|', arrows: true, dropShadow: false, cluetipClass: 'jtip'}); $('a.jt:eq(2)').cluetip({ cluetipClass: 'jtip', arrows: true, dropShadow: false, height: '150px', sticky: true, positionBy: 'bottomTop' }); $('a.jt:eq(3)').cluetip({local: true, hideLocal: false}); $('a.jt:eq(4)').cluetip({ cluetipClass: 'jtip', arrows: true, dropShadow: false, onActivate: function(e) { var cb = $('#cb')[0]; return !cb || cb.checked; } }); // Rounded Corner theme $('ol.rounded a:eq(0)').cluetip({splitTitle: '|', dropShadow: false, cluetipClass: 'rounded', showtitle: false}); $('ol.rounded a:eq(1)').cluetip({cluetipClass: 'rounded', dropShadow: false, showtitle: false, positionBy: 'mouse'}); $('ol.rounded a:eq(2)').cluetip({cluetipClass: 'rounded', dropShadow: false, showtitle: false, positionBy: 'bottomTop', topOffset: 70}); $('ol.rounded a:eq(3)').cluetip({cluetipClass: 'rounded', dropShadow: false, sticky: true, ajaxCache: false, arrows: true}); $('ol.rounded a:eq(4)').cluetip({cluetipClass: 'rounded', dropShadow: false}); });
更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery日期与时间操作技巧总结》、《jQuery切换特效与技巧总结》、《jQuery拖拽特效与技巧总结》、《jQuery扩展技巧总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》、《jquery选择器用法总结》及《jQuery常用插件及用法总结》
希望本文所述对大家jQuery程序设计有所帮助。

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

jQuery引用方法详解:快速上手指南jQuery是一个流行的JavaScript库,被广泛用于网站开发中,它简化了JavaScript编程,并为开发者提供了丰富的功能和特性。本文将详细介绍jQuery的引用方法,并提供具体的代码示例,帮助读者快速上手。引入jQuery首先,我们需要在HTML文件中引入jQuery库。可以通过CDN链接的方式引入,也可以下载

jQuery中如何使用PUT请求方式?在jQuery中,发送PUT请求的方法与发送其他类型的请求类似,但需要注意一些细节和参数设置。PUT请求通常用于更新资源,例如更新数据库中的数据或更新服务器上的文件。以下是在jQuery中使用PUT请求方式的具体代码示例。首先,确保引入了jQuery库文件,然后可以通过以下方式发送PUT请求:$.ajax({u

jQuery如何移除元素的height属性?在前端开发中,经常会遇到需要操作元素的高度属性的需求。有时候,我们可能需要动态改变元素的高度,而有时候又需要移除元素的高度属性。本文将介绍如何使用jQuery来移除元素的高度属性,并提供具体的代码示例。在使用jQuery操作高度属性之前,我们首先需要了解CSS中的height属性。height属性用于设置元素的高度

标题:jQuery小技巧:快速修改页面所有a标签的文本在网页开发中,我们经常需要对页面中的元素进行修改和操作。在使用jQuery时,有时候需要一次性修改页面中所有a标签的文本内容,这样可以节省时间和精力。下面将介绍如何使用jQuery快速修改页面所有a标签的文本,同时给出具体的代码示例。首先,我们需要引入jQuery库文件,确保在页面中引入了以下代码:<

标题:使用jQuery修改所有a标签的文本内容jQuery是一款流行的JavaScript库,被广泛用于处理DOM操作。在网页开发中,经常会遇到需要修改页面上链接标签(a标签)的文本内容的需求。本文将介绍如何使用jQuery来实现这个目标,并提供具体的代码示例。首先,我们需要在页面中引入jQuery库。在HTML文件中添加以下代码:

jQuery是一款广泛应用于前端开发的快速、小巧、功能丰富的JavaScript库。自2006年发布以来,jQuery已经成为众多开发者的首选工具之一,但是在实际应用中,它也不乏一些优势和劣势。本文将深度剖析jQuery的优势与劣势,并结合具体的代码示例进行说明。优势:1.简洁的语法jQuery的语法设计简洁明了,可以大大提高代码的可读性和编写效率。比如,

jQuery是一种流行的JavaScript库,被广泛用于处理网页中的DOM操作和事件处理。在jQuery中,eq()方法是用来选择指定索引位置的元素的方法,具体使用方法和应用场景如下。在jQuery中,eq()方法选择指定索引位置的元素。索引位置从0开始计数,即第一个元素的索引是0,第二个元素的索引是1,依此类推。eq()方法的语法如下:$("s

如何判断jQuery元素是否具有特定属性?在使用jQuery操作DOM元素时,经常会遇到需要判断元素是否具有某个特定属性的情况。这种情况下,我们可以借助jQuery提供的方法来轻松实现这一功能。下面将介绍两种常用的方法来判断一个jQuery元素是否具有特定属性,并附上具体的代码示例。方法一:使用attr()方法和typeof操作符//判断元素是否具有特定属
