一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

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。通过虚假的价值导致容器不再捕获所有文档事件。相反,该容器内的对象仍然火灾事件,这些事件也和泡沫预期。

---这是高山编辑。




热门栏目