最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to make div invisible to still able to click? - Stack Overflow

programmeradmin4浏览0评论

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

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

Share Improve this question asked Dec 5, 2012 at 12:16 FatDogMarkFatDogMark 1,2052 gold badges16 silver badges26 bronze badges 1
  • Please share your HTML and CSS markup along with whatever javascript you've tried. – davidethell Commented Dec 5, 2012 at 12:17
Add a ment  | 

3 Answers 3

Reset to default 7

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!

发布评论

评论列表(0)

  1. 暂无评论