CSS代码

.tbui_aside_float_bar
{
position: fixed;
left: 50%;
bottom: 120px;
margin-left: 608px;
border-top: 1px solid #e5e5e5;
z-index: 11;
_position: absolute;
_top: expression(documentElement.scrollTop+documentElement.clientHeight - this.offsetHeight-100);
}
.tbui_aside_float_bar li a
{
display: block;
width: 55px;
height: 55px;
background: url(/image/sidebar.png) no-repeat;
outline: 0;
}
.tbui_aside_float_bar li.tbui_fbar_fav a:hover
{
background-position: -55px 0px;
}
.tbui_aside_float_bar li.tbui_fbar_fav a
{
}
.tbui_aside_float_bar li.tbui_fbar_share a:hover
{
background-position: -55px -55px;
}
.tbui_aside_float_bar li.tbui_fbar_share a
{
background-position: 0 -55px;
}
.tbui_aside_float_bar li.tbui_fbar_top a:hover
{
background-position: -55px -110px;
}
.tbui_aside_float_bar li.tbui_fbar_top a
{
background-position: 0 -110px;
}

HTML代码

    <div class="sidebar">
<div id="hoverDiv" class="hoverDiv" style="position: absolute; display: block;border: 1px solid #e9e9e9;">
<div class="hoverDivConent">
<h6 style="background-color: #f6f6f6; text-align:right;">
为您服务</h6>
<ul>
<li>1号</li>
<li>2号</li>
<li>3号</li>
</ul>
</div>
</div>
<ul class="tbui_aside_float_bar"> <li class="tbui_aside_fbar_button tbui_fbar_share"><a id="share" class="hover_button"
href="#"></a></li>
</ul>
</div>

JAVAScript

    <script type="text/javascript">
$(document).ready(function () { $.fn.queueInterruptibleAction = function (delayMilseconds, actionCallback) {
//cancel if other action exist
this.cancelInterruptibleAction();
// delay execute delayCallback
var timerId = window.setTimeout(function () {
$.removeData(this, 'timerId');
actionCallback.call(this);
}, delayMilseconds);
$.data(this, 'timerId', timerId);
}; $.fn.cancelInterruptibleAction = function () {
var timerId = $.data(this, 'timerId');
if (timerId != null) {
$.removeData(this, 'timerId');
window.clearTimeout(timerId);
}
}; //tClass=TargetClass,pClass=ParentClass
$.fn.delayHover = function (tClass, pClass, enterDelay, leaveDelay) {
if (enterDelay == null) enterDelay = 150;
if (leaveDelay == null) leaveDelay = 400;
return this.each(function () {
var trigger = $(this); //button
var target = $(this).closest(pClass).find(tClass); //view trigger.mouseenter(function () {
x = trigger.offset();
target.css("left", x.left - 100);
target.css("top", x.top + 2);
target.queueInterruptibleAction(enterDelay, function () {
target.fadeIn();
});
});
trigger.mouseleave(function () {
target.queueInterruptibleAction(leaveDelay, function () {
target.fadeOut();
});
});
target.mouseenter(function () {
target.cancelInterruptibleAction();
});
target.mouseleave(function () {
target.queueInterruptibleAction(leaveDelay, function () {
target.hide();
});
});
});
}; $('.hover_button').delayHover('.hoverDiv', '.sidebar', 150, 400);
}); //end of document.ready </script>

  

JQuery Delay Hover效果的更多相关文章

  1. jQuery怎么去掉标签的hover效果

    今天项目中遇到jquery去掉hover效果的问题,开始以为直接unbind(“hover”)就可以搞定,可是实际验证这个方法并没有作用,正确的使用方法应该是下面这样: /* 这种方法是新增的,在老的 ...

  2. JQuery实现广告效果(滚动切换)

    JQuery实现广告效果(滚动切换)   Html+css 效果如上图 代码: <!DOCTYPE html> <html> <head lang="en&qu ...

  3. jQuery之动画效果show()......animate()

    jQuery之动画效果 1.show()显示效果 语法:show(speed,callback) Number/String,Function speend为动画执行时间,单位为毫秒.也可以为slow ...

  4. jquery live hover事件的替代写法

    HTML中的hover行为通常在样式中定义,利用jquery实现此效果有两种情况. 第一种是常见的针对页面中静态的元素,以改变元素样式中的border-color为例,写法如下: $(function ...

  5. jquery特效 幻灯片效果

    jquery特效 幻灯片效果,效果图如下: <!DOCTYPE html> <html> <head> <meta http-equiv="Cont ...

  6. 使用jquery实现放大镜效果

    原文:使用jquery实现放大镜效果 实现原理 首先,我们讲解一下放大镜效果的实现方式: 方法一:准备一张高像素的大图,当鼠标放到原图上,加载显示大图的对应位置. 方法二:对原图片进行放大,也就是调整 ...

  7. jQuery的hover方法搭配css的hover选择器,实现选中元素突出显示

    问题简述: 今天做帮一个师姐做网页遇到一个这样的要求: 鼠标不移动进表格,表格透明度不变. 鼠标移动进表格,hover到的单元格透明度不变,没hover到的单元格透明度改变. 先贴我已经实现好的效果, ...

  8. jQuery操作之效果

    jQuery操作之效果 效果操作一共分五类:1.基本,2.滑动,3.淡入淡出,4.自定义,5.设置 show(),hide(),toggle() 代码如下: html代码: <p style=& ...

  9. jQuery中hover与mouseover和mouseout的区别分析

    本文实例分析了jQuery中hover与mouseover和mouseout的区别.分享给大家供大家参考,具体如下: 以前一直以为在jquery中其实mouseover和mouseout两个事件等于h ...

随机推荐

  1. C与C++连续赋值的区别

    int a,b,c,d; a = b = ; // ( a!=b?a:b) = 1000;//如果a不等于b 那么a = 100;这句话执行完 a还是等于5,b= 100: printf(" ...

  2. javascript Math.pow 函数 详解

    语法 Math.pow(x,y) 定义和用法 pow() 方法可返回 x 的 y 次幂的值. 处理简单数学问题 6的4次方等于1296,记作:64=1296; 求值: Math.pow(6,4)=12 ...

  3. varnish中忽略cookie进行缓存

    varnish不缓存cookie的页面,如果html页面中带有cookie以下代码为接收到结尾的文件,自动去除掉cookiesub vcl_recv {    if (req.request == ” ...

  4. Andrew Ng机器学习公开课笔记 -- Mixtures of Gaussians and the EM algorithm

    网易公开课,第12,13课 notes,7a, 7b,8 从这章开始,介绍无监督的算法 对于无监督,当然首先想到k means, 最典型也最简单,有需要直接看7a的讲义   Mixtures of G ...

  5. Yii2 捕获错误日志

    在技术开发中,捕获程序框架错误,是非常必要的一件事情,我们公司使用Yii2框架,简单说下Yii2的错误捕获处理 Yii2 web应用 1 配置如下 其中errorHandler就是错误处理配置,执行E ...

  6. Python之创建tuple和“可变”的tuple

    Python之创建tuple tuple是另一种有序的列表,中文翻译为" 元组 ".tuple 和 list 非常类似,但是,tuple一旦创建完毕,就不能修改了. 同样是表示班里 ...

  7. 低功耗蓝牙4.0BLE编程-nrf51822开发(8)-GATT

    The Generic Attribute Profile (GATT)使用属性定义一个服务框架,定义了服务和特性的过程和数据格式,包含发现.读取.写入.通知指示特性和配置特性广播. GATT配置文件 ...

  8. 在脚本中操作plist文件

    终端输入: /usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" /Users/achen/Desktop/testBundl ...

  9. zepto源码--几个判断函数--学习笔记

    几个需要经常用到的类型判断: 自定义一个类似于typeof的函数,提供更多的类型判断. class2type[toString.call(obj)] 是对class2type的取值 在后面通过循环对c ...

  10. php--列表展示(小实训一月考)

    效果图: