最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
jquery 浮动窗口详细实现方法
时间:2010-09-08 编辑:简简单单 来源:一聚教程网
文章来讲一款jquery 浮动窗口详细实现方法与实例应用,我们很清楚的利用了jquery浮动插件来实例下面的效果。当一个容器对象,例如一个div,已捕获鼠标,活动的对象是原产于该容器内发射的分区,除非setcapture方法bcontainercapture参数设置为false。通过虚假的价值导致容器不再捕获所有文档事件。相反,该容器内的对象仍然火灾事件,这些事件也和泡沫预期。
---这是高山编辑。
js代码
function drag(overflow,title){
title.onmousedown = function(evt){
var doc = document;
var evt = evt || window.event;
var x = evt.offsetx?evt.offsetx:evt.layerx;
var y = evt.offsety?evt.offsety:evt.layery;
if(overflow.setcapture){
overflow.setcapture();
}else if(window.captureevents){
window.captureevents(event.mousemove|event.mouseup);
}
doc.onmousemove = function(evt){
evt = evt || window.event;
var xposition = evt.pagex || evt.clientx;
var yposition = evt.pagey || evt.clienty;
var newx = xposition - x;
var newy = yposition - y;
overflow.style.left = newx;
overflow.style.top = newy;
};
doc.onmouseup = function(){
if(overflow.releasecapture){
overflow.releasecapture();
}else if(window.captureevents){
window.captureevents(event.mousemove|event.mouseup);
}
doc.onmousemove=null;
doc.onmouseup=null;
};
};
}
html代码
浮动窗口
css教程" rel="stylesheet" href="css/overflow.css" />
这只是一个演示标题[ x ]
当一个容器对象,例如一个div,已捕获鼠标,活动的对象是原产于该容器内发射的分区,除非setcapture方法bcontainercapture参数设置为false。通过虚假的价值导致容器不再捕获所有文档事件。相反,该容器内的对象仍然火灾事件,这些事件也和泡沫预期。
---这是高山编辑。
-
上一个: jquery淡入淡出效果与注意事项
-
下一个: js 浏览器 前进了 后退 刷新代码
相关文章
- jQuery模拟窗口抖动效果 06-27
- jQuery窗口拖动功能的实现代码 03-13
- jquery 在新窗口打开链接实现方法 10-07
- 在新窗口打开链接的jquery代码 04-22
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31