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. wordpress为dashboard添加样式

    function my_admin_theme_style() { wp_enqueue_style('my-admin-style', get_template_directory_uri() . ...

  2. shell执行mysql操作

    http://ully.iteye.com/blog/1226494 http://www.jb51.net/article/55207.htm shell执行mysql操作 mysql  -hhos ...

  3. HK游记 Day2迪斯尼(下)

    接下来我们要去看狮子王庆典,绕啊绕啊,终于进场了,说实话我对一大帮人扮演动物歌舞表演不是很感冒,静倒是觉得很好看,印象最深的是狮子王的主题曲,还有大象车,长颈鹿车,狮子王车,静举着手机拍视频. 看完表 ...

  4. Law of total probability

    https://en.wikipedia.org/wiki/Law_of_total_probability the total probability of an outcome which can ...

  5. GATT 服务器与客户端角色

    两个设备应用数据的通信是通过协议栈的GATT层实现的.从GATT角度来看,当两个设备建立连接后,他们处于以下两种角色之一: GATT服务器: 它是为GATT客户端提供数据服务的设备 GATT客户端:  ...

  6. Simplest way to serve static data from outside the application server in a Java web application

    tomcat service.xml <Context docBase="/path/to/images" path="/images" /> re ...

  7. Difference between _, __ and __xx__ in Python

    When learning Python many people don't really understand why so much underlines in the beginning of ...

  8. zepto源码--qsa--学习笔记

    zepto内部选择器qsa方法的实现. 简述实现原理: 通过判断传入的参数类型: 如果是'#id',则使用getElementById(id)来获取元素,并且将结果包装成数组形式: 如果是'.clas ...

  9. sublime删除安装的插件

    如果想要删除插件,Ctrl+Shift+P调出命令面板,输入remove,调出Remove Package选项并回车,选择要删除的插件即可

  10. [LeetCode] Combination Sum II (递归)

    Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in ...