# Dumb javascript question

**URL:** https://forum.kirupa.com/t/dumb-javascript-question/187756
**Category:** web dev
**Created:** [May 2, 2006, 3:02am UTC](https://forum.kirupa.com/t/dumb-javascript-question/187756 "2006-05-02T03:02:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![leisuresuitlissy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/leisuresuitlissy/32/2109_2.png) [@leisuresuitlissy](https://forum.kirupa.com/u/leisuresuitlissy)
#### Post date: [May 2, 2006, 3:02am UTC](https://forum.kirupa.com/t/dumb-javascript-question/187756/1 "2006-05-02T03:02:26Z")

</div>

Hi. I am trying to get some javascript working that \*\*after 5 seconds \*\*hides a div when the user rolls off. What I have in the head tag is:

```auto
 
function timeOut()
{
setTimeout(MM_showHideLayers,4000);
}
function MM_showHideLayers() { //v6.0
alert("stuff");
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args*))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

```

and the function is called like this:

```auto
onMouseOut="timeOut();MM_showHideLayers('ESSSimulations','','hide')"

```

For some reason this is not working, and I don’t know enough about JS to work out why…

If anyone could help I would be very grateful 🙂

Thanks  
Melissa
