Only show DIV Box if it has content
Question by Guest | 2015-04-04 at 18:00
I am loading some images (products) into an HTML DIV box (container) dynamically. However, this box should only be shown, if there is actually data and content loaded.
At the moment, there is always an empty box displayed. How am I able to solve that?
Related Topics
jQuery: Show or hide DIV-Container depending on Checkbox State
Tutorial | 0 Comments
jQuery: Show a DIV - Hide other DIVs
Tutorial | 0 Comments
jQuery: Load and Replace DIV Content with clicking Links
Tutorial | 0 Comments
JavaScript: Show and hide HTML area by clicking a link
Tutorial | 0 Comments
jQuery: Make Full DIV Container Clickable
Question | 3 Answers
jQuery: Show and hide elements
Tutorial | 0 Comments
jQuery: Read and Change Data Attribute Value
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Perhaps, the simplest solution is to not specify the height of the DIV (CSS: height: auto).
With this, the height of the DIV would automatically adapt to the content and if there should be no content in the box, the box will become so small that it remains invisible.
2015-04-06 at 23:36