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. Unix时间戳(Unix timestamp)转换工具

    http://tool.chinaz.com/Tools/unixtime.aspx 现在的Unix时间戳(Unix timestamp)是   1440732364         Unix时间戳( ...

  2. w_click_twice

    var w_global_obj; var dat = new Date(); var w_golbal_count_millseconds; function w_click_twice(w_cur ...

  3. Greedy_algorithm

    https://en.wikipedia.org/wiki/Greedy_algorithm

  4. java.lang.ClassNotFoundException: springosgi

    该问题困扰多天,终于查到原因. 问题:对webwork源码的修改始终无法加载,osgi总是读取源码中未修改的类 com.opensymphony.webwork.dispatcher.Dispatch ...

  5. 例题.点击按钮显示内容+弹窗效果+ajax

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. c语言作业

  7. pomelo架构概览

    pomelo之所以简单易用.功能全面,并且具有高可扩展性.可伸缩性等特点,这与它的技术选型和方案设计是密不可分的.在研究大量游戏引擎设计思路基础上,结合以往游戏开发的经验,确定了pomelo框架的设计 ...

  8. 关于HBase的概述

    1.hbase的特点 ->数据存储量可以达到亿级别数据维持在秒级 ->按列存储的数据库 ->能够存储上百万列 ->hbase的底层存储依赖于HDFS ->如何扩展hbas ...

  9. php--validate错误信息提示样式

    //validate  错误信息提示样式  可以提示错误信息 可以使用jq 自带的属性改变错误的显示的位置,其中element是验证未通过的当前表单元素,error为错误后的提示信息 [注意]:放的位 ...

  10. ADO.NET中主要对象

    ADO.NET是什么? ADO.NET是.Net平台提供和数据库交互的类库集,我们可以通过它对SQLSERVER,XML,Oracle等这样的数据源进行访问. 应用程序可以使用ADO.NET链接到数据 ...