简体   繁体   中英

How to make div invisible to still able to click?

How to make div invisible to still able to click? display hidden or hide() will make it disappear but I want user still able to click it, as i put it on top of another object

You could set its opacity to 0 . The opacity can be animated using animate :

$('#mydiv').animate({opacity: 0});

If the <div/> does not contain any contents, you could:

#mydiv {
  background-color: transparent;
  height: 50px;
  width: 50px;
}

See the CSS2.1 property background-color

Maybe you'd like to use opacity:0; or visibility:hidden; :

.element {
  opacity:0;
}

or:

.element {
  visibility:hidden;
}

Hope it works! Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM