/* 图标功能加载*/
nav : function () {
var posX;
var posY;
var fwuss = $(".quick-nav")[0];
fwuss.onmousedown = function(e) {
//鼠标聚焦
fwuss.setCapture && fwuss.setCapture();
var disX = (e || event).clientX;
var disY = (e || event).clientY;
posX = disX - fwuss.offsetLeft;//获得横坐标x
posY = disY - fwuss.offsetTop;//获得纵坐标y
//监听拖拽线高
document.onmousemove = function(ev) {
//鼠标距离
var iT = (ev || event).clientX - posX;
var eT = (ev || event).clientY - posY;
fwuss.style.margin = 0;
fwuss.style.left = iT + "px";
fwuss.style.right = "auto";
fwuss.style.top = eT + "px";
return false
}
document.onmouseup = function() {
document.onmousemove = null;
document.onmouseup = null;
fwuss.releaseCapture && fwuss.releaseCapture();
};
return false;
};
}
网友评论