steveai steveai - 3 months ago 12
CSS Question

I need a div to activate after 10 seconds

On my website www.polymath.io there is a menu div that basically is a little + sign in a box. Apparently this is hard to see for many so I'm wondering if I can somehow activate

div.mobile_menu.open
.

I need to go from default:

div.mobile_menu.close


to

div.mobile_menu.open


after 10 seconds.

Thanks!

Answer

Use the setTimeout() function. See below:

setTimeout(function(){
    //Change menu to open here.
},10000);

The number at the end of the function is in milliseconds.

Comments