MaxelRus MaxelRus - 6 months ago 45
Javascript Question

How to make the whole div clickable

I'm making a menu and have one simple and stupid issue. The problem is: I have my

elements inside a 'Menu'
. With id
. I've made a feature by which you can't accidentally click on the
inside the
through CSS
. But now if you click the menu in space between white stripes, it won't act like a button.

So the question is: 'How to make this
fully clickable?'

Here's the Fiddle.

Thanks in advance.


simply do this add a width to menu div

#menu {
    -moz-user-select: none;
    height: 40px;
    margin: 50px;
    position: absolute;
    width: 40px; /* newly added */