`
ego008
  • 浏览: 150670 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

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

    博客分类:
  • JS
阅读更多

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

 

再动一下鼠标又出现。

 

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

0
1
分享到:
评论
2 楼 ego008 2011-11-10  
技术上不难,创意难。
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';
};

没啥难的!

相关推荐

Global site tag (gtag.js) - Google Analytics