admin管理员组文章数量:1323348
I need to create a DIV that has some content (some of which is hidden) and when you click on it, it expands and reveals the rest of its content..
I have found many HOWTOs but use jQuery....
I would like a solution using CSS and HTML (Javascript is good also!)
Thanks in advance!
I need to create a DIV that has some content (some of which is hidden) and when you click on it, it expands and reveals the rest of its content..
I have found many HOWTOs but use jQuery....
I would like a solution using CSS and HTML (Javascript is good also!)
Thanks in advance!
Share Improve this question asked Jun 29, 2012 at 10:22 ant0niskant0nisk 5911 gold badge4 silver badges18 bronze badges 10- You do realize that jQuery is a JavaScript library? – Bram Vanroy Commented Jun 29, 2012 at 10:23
- Hmmm... I am not Familiar with jQuery.... Thanx for the Info! :-) – ant0nisk Commented Jun 29, 2012 at 10:24
- However, I would like a solution that accepts CLASSES.. What I found with jQuery, is ONLY with IDs.... – ant0nisk Commented Jun 29, 2012 at 10:26
- May be it's better if you learn about Jquery. Then ask question – sandeep Commented Jun 29, 2012 at 10:27
- That is what I will probably do soon.... – ant0nisk Commented Jun 29, 2012 at 10:28
1 Answer
Reset to default 4<div id="sample"></div>
css
#sample {
border: 1px solid black;
height: 15px;
padding: 12px;
overflow: hidden;
}
javascript
document.getElementById("sample").onclick = function() {
this.style.height = 'auto';
}
you can use some jquery for animated div
本文标签: javascriptCSS and HTML How to create an Expanding DIV On ClickStack Overflow
版权声明:本文标题:javascript - CSS and HTML: How to create an Expanding DIV On Click? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742131127a2422164.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论