当前位置: 代码迷 >> Web前端 >> 看到一个网站很眩,监听鼠标事件,闲工夫时隐藏
  详细解决方案

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

热度:84   发布时间:2012-09-07 10:38:15.0
看到一个网站很眩,监听鼠标事件,空闲时隐藏

效果很眩,当鼠标停止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  
技术上不难,创意难。
  相关解决方案