读书人

看到一个网站很眩监听鼠标事件闲工

发布时间: 2012-09-07 10:38:15 作者: rapoo

看到一个网站很眩,监听鼠标事件,空闲时隐藏

效果很眩,当鼠标停止5秒不动时,隐藏页面的某些部分,

?

再动一下鼠标又出现。

?

效果:?http://xheight.co.uk/

1 楼 sniciq 2011-11-10 xheight.onMouseMove = function()
{
xheight.mouseIdle = false;
clearTimeout(xheight.mouseTimeout);
xheight.mouseTimeout = setTimeout(xheight.onMouseTimeout, 5000);
docObj.removeClass('mouse-idle');
};

xheight.onMouseTimeout = function()
{
if (xheight.mouseIdle) return;
xheight.mouseIdle = true;
clearTimeout(xheight.mouseTimeout);
docElement.className += ' mouse-idle';
};

没啥难的! 2 楼 ego008 2011-11-10 技术上不难,创意难。

读书人网 >Web前端

热点推荐